Repository navigation
Conversation
dvd233
marked this pull request as ready for review
October 6, 2026 23:29
This branch has not been deployed
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.
Description
A pending
navigator.permissions.query()can resolve after its effect has been cleaned up, either on unmount or after the permission descriptor changes. The callback still adds achangelistener, which the completed cleanup never removes.Check
mountedbefore storing the returned status or subscribing. Add four tests covering normal change events and cleanup, resolution after unmount, an obsolete descriptor query resolving after the current query, and rejection without subscribing.Validation
Independent native validation run compares upstream
fbe99c6with source commit02ede5f, using the unchangedyarn.lockandyarn install --frozen-lockfile.yarn testpasses on Ubuntu Node 20.20.2 / 22.23.3 and macOS Node 20.20.2 / 22.23.2. Each configuration reports 76 suites / 492 tests for the baseline and 77 suites / 496 tests for the candidate, with no skips.yarn build,yarn lintandyarn lint:typespass on both versions on Ubuntu Node 20, matching the upstream quality-job scope.Both versions retain the same 97 lint warnings and 29 peer-dependency warnings. The existing ts-jest
sourceMap: falsewarning remains. The Ubuntu Node 20 baseline also reports a worker teardown warning while exiting successfully; its absence on the candidate is not treated as evidence for this fix.Targeted coverage
A separate original-lock coverage run ran the same four tests on Ubuntu / Node 20, collecting only
src/usePermission.ts:The remaining uncovered statement and branch locations are in the existing
onChangemounted-state check and optional-chain/nullish fallback. Whole-hook coverage is below 100%; that checklist item remains unchecked.This patch and its regression tests were written and reviewed by AI coding agents. The checks above were executed against the linked commits.
Type of change
Checklist
yarn test)yarn lint; existing warnings noted above)yarn lint:types)