Skip to content

[fix] Linking: register listeners once and remove by identity - #2901

Open
KuroGeo wants to merge 1 commit into
necolas:masterfrom
KuroGeo:fix/linking-listener-identity
Open

KuroGeo wants to merge 1 commit into
necolas:masterfrom
KuroGeo:fix/linking-listener-identity

Conversation

@KuroGeo

@KuroGeo KuroGeo commented Oct 9, 2026

Copy link
Copy Markdown

The first Linking.addEventListener('onOpen', callback) registration adds its callback twice, so opening a URL invokes it twice. Removing a listener also compares function source text, which can remove a different callback with the same implementation (such as closures created by a factory).

Initialize the listener list empty and remove callbacks by identity in both the subscription and deprecated removal paths. Three regressions cover one notification per registration, independent callbacks with identical source, and the deprecated API. All three fail before the fix.

Validation: complete DOM and Node suites pass (724 tests, 6 existing skips, 220 snapshots); repository formatting and lint checks pass. Flow is not verified locally: its pinned 0.148.0 macOS binary exits with architecture error -86 on this arm64 host. Upstream CI runs the checker on Linux.

AI assistance: OpenAI Codex implemented the fix and regression tests on behalf of @KuroGeo.

@codesandbox-ci

codesandbox-ci Bot commented Oct 9, 2026

Copy link
Copy Markdown

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit ca9fd09:

Sandbox Source
react-native-web-examples Configuration

This branch has not been deployed

No deployments
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.

1 participant