Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] thread safety with EventProducer's fire events #2034

Merged
merged 1 commit into from
Mar 29, 2024

Conversation

jkasten2
Copy link
Member

@jkasten2 jkasten2 commented Mar 22, 2024

Description

One Line Summary

Fixes bug where EventProducer.fire can throw when another thread calls EventProducer.remove.

Details

Motivation

SDK should be stable and not cause crashes.

Related Issues

Fixes #2007

Scope

Only affects EventProducer.

Testing

Unit testing

Added a new EventProducerTest.

Manual testing

Ran on an Android 6 emulator ensuring it subscribes for push.

Affected code checklist

  • Notifications
    • Display
    • Open
    • Push Processing
    • Confirm Deliveries
  • Outcomes
  • Sessions
  • In-App Messaging
  • REST API requests
  • Public API changes

Checklist

Overview

  • I have filled out all REQUIRED sections above
  • PR does one thing
  • Any Public API changes are explained in the PR details and conform to existing APIs

Testing

  • I have included test coverage for these changes, or explained why they are not needed
  • All automated tests pass, or I explained why that is not possible
  • I have personally tested this on my device, or explained why that is not possible

Final pass

  • Code is as readable as possible.

  • I have reviewed this PR myself, ensuring it meets each checklist


This change is Reviewable

@jkasten2 jkasten2 force-pushed the fix/op-repo-fix-keeping-cpu-awake branch from 60a4280 to fd60e70 Compare March 28, 2024 21:50
Base automatically changed from fix/op-repo-fix-keeping-cpu-awake to main March 28, 2024 22:48
Test confirmed java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
fails on .toList() before change.
@jkasten2 jkasten2 force-pushed the fix/event-producer-thread-safe branch from af70434 to d798815 Compare March 28, 2024 23:03
@jkasten2 jkasten2 merged commit b44b489 into main Mar 29, 2024
2 of 3 checks passed
@jkasten2 jkasten2 deleted the fix/event-producer-thread-safe branch March 29, 2024 16:41
@jkasten2 jkasten2 mentioned this pull request Mar 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: EventProducer.fire (1) - Fatal Exception: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
4 participants