Repository navigation
Conversation
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.
Summary
A failed Frida session handshake, script load, or resume could lose the caller cancellation that arrived while the request or its final cleanup settled. The service now retains the exact caller reason as a secondary failure alongside the original physical error.
Problem and expected behavior
The one-shot load and resume failure paths closed the session and returned their primary error without reconciling the final caller signal. Failed start handshakes had the same omission. Callers need both the physical result and later cancellation, including when close also fails.
Change and scope
The service uses the existing shared cancellation owner for failed starts and consolidates load/resume failure cleanup into one private method. That method composes cleanup dependencies and attaches late caller cancellation after close. This is a lifecycle repair within existing Frida application authority, found during the repository audit.
Related PR #9934 changes capture-policy facts and touches separate assertions in the same test file. Its test patch applies cleanly on this branch.
Contract and boundary impact
The application service owns request finalization and the provider owns acquired Frida resources. Existing error projection exposes the retained secondary cancellation through the established error contract. Original failure identity, diagnostic facts, and cleanup dependencies stay available.
The checked effects describe the existing Frida workflow. Validation used simulated providers.
Evidence and regression coverage
Eight assertions fail on base
a6e02657because secondary failures are empty. They cover both failed-start entry points, physical script-load failure before and during cleanup, and physical resume failure, including successful and failed close. After repair, all 37 service tests pass, including existing pending-start cleanup, completed script delivery, typed cancellation, retained source/message Evidence, and cleanup retry controls.Validation performed
All commands used Node.js 24.22.1 in the isolated branch worktree.
npm run typecheck -- --incremental falsepassed.src/application/frida/FridaInstrumentationService.test.tspassed 37 tests.oxfmt --check,oxlint, andgit diff --checkpassed. Lint retained existing size, complexity, and parameter-count warnings.Compatibility, safety, and release
The repair uses the established secondary-error contract. Real Frida attach, spawn, script execution, and remote cleanup were outside this verification. Package and installation contracts continue to apply.
Author readiness
Human owner:
Before merge
type(scope): outcome.