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(android): protect against headlessJS task multiple-invocation #1176

Merged
merged 2 commits into from
Dec 20, 2024

Conversation

mikehardy
Copy link
Collaborator

This adds some protection in the headlessJS area against draining the task queue multiple times and/or invoking the same task multiple times - both aimed at preventing the unfortunate possible result of race conditions while draining the task queue of any tasks that came in while react-native startup was happening

Copy link

docs-page bot commented Dec 20, 2024

To view this pull requests documentation preview, visit the following URL:

docs.page/invertase/notifee~1176

Documentation is deployed and generated using docs.page.

@mikehardy mikehardy added the pending-merge Waiting on CI or question responses to merge, but otherwise ready label Dec 20, 2024
Copy link

codecov bot commented Dec 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.08%. Comparing base (2c24dd1) to head (633bf67).
Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1176   +/-   ##
=======================================
  Coverage   77.08%   77.08%           
=======================================
  Files          32       32           
  Lines        1727     1727           
  Branches      556      579   +23     
=======================================
  Hits         1331     1331           
  Misses        395      395           
  Partials        1        1           

it was possible if multiple tasks came in at once while react-native
headlessJS was performing initial react-native startup for the queued
events to be invoked multiple times once startup finished

this is protected via a couple mechanisms now
@mikehardy mikehardy force-pushed the @mikehardy/headlessjs-prevent-multiple-invoke branch from 3bcb106 to 633bf67 Compare December 20, 2024 01:21
@mikehardy mikehardy removed the pending-merge Waiting on CI or question responses to merge, but otherwise ready label Dec 20, 2024
@mikehardy mikehardy merged commit a799167 into main Dec 20, 2024
11 checks passed
@mikehardy mikehardy deleted the @mikehardy/headlessjs-prevent-multiple-invoke branch December 20, 2024 01:31
Copy link

🎉 This PR is included in version 9.1.8 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released Issue or PR has a fix released by semantic-release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant