fix: route screenPopped event to correct handler#8266
Open
fix: route screenPopped event to correct handler#8266
Conversation
…server registerScreenPoppedListener was wired to notifyPreviewCompleted instead of notifyScreenPopped, causing screenPopped events to be dispatched as previewCompleted. This prevented component listeners with a screenPopped handler from receiving the event (e.g. after iOS swipe-back gesture). Made-with: Cursor
There was a problem hiding this comment.
Pull request overview
Fixes misrouting of the native screenPopped event so component listeners receive it via the correct handler, restoring expected behavior after iOS swipe-back pops a screen.
Changes:
- Wire
registerScreenPoppedListenertonotifyScreenPopped(instead ofnotifyPreviewCompleted) inComponentEventsObserver.registerOnceForAllComponentEvents().
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
registerScreenPoppedListenerinComponentEventsObserver.registerOnceForAllComponentEvents()was wired tothis.notifyPreviewCompletedinstead ofthis.notifyScreenPoppedscreenPoppedevents (emitted after iOS swipe-back gesture pops a screen) to be dispatched aspreviewCompletedto component listeners, meaning no listener with ascreenPoppedhandler would ever receive the eventContext
Reported via SCHED-45583 and Slack thread.
After the fix in PR #8222 to emit
screenPoppedon swipe-back, the event still didn't reach component listeners because of this wiring bug.