Conversation
There was a problem hiding this comment.
🟢 Approval recommended
The functional changes are narrowly scoped to cancellation semantics, appear consistent with the stated contract, and are backed by targeted tests (with only a minor csproj packaging consistency nit).
Pull request overview
This PR normalizes biometric authorization cancellation behavior so user cancellation is handled as a standard “rejected authorization” (false) instead of surfacing as an exception in certain paths, and aligns Android’s negative button behavior with that contract.
Changes:
- Catch
OperationCanceledExceptionat theWalletAuthorizationService.RequestAuthorizationAsyncboundary and treat it as a rejected authorization (false) for both locked and already-unlocked wallet flows. - Update Android’s biometric negative button to complete authentication with
falserather than canceling the task. - Add a focused test project for audit item P2-03 and include it in
OneGateApp.slnx.
File summaries
| File | Description |
|---|---|
| tests/P2-03/README.md | Adds run instructions and scope notes for the P2-03 cancellation test set. |
| tests/P2-03/PlatformStubs.cs | Provides minimal platform/service stubs so the production authorization service can be exercised in tests. |
| tests/P2-03/AuthorizationCancellationTests.cs | Adds tests covering cancellation (locked/unlocked), rejection, success, and propagation of non-cancellation failures. |
| tests/P2-03/AuthorizationCancellation.Tests.csproj | Introduces the dedicated test project and links in the production authorization service source. |
| OneGateApp/Services/WalletAuthorizationService.cs | Treats OperationCanceledException as a rejected authorization consistently at the service boundary. |
| OneGateApp/Services/DataProtectionService.Android.cs | Changes biometric negative button handling to return false instead of canceling the task. |
| OneGateApp.slnx | Includes the new P2-03 test project in the solution. |
Review details
- Files reviewed: 7/7 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| <ProjectReference Include="../../OneGateApp/OneGateApp.csproj" ReferenceOutputAssembly="false" BuildReference="false" SkipGetTargetFrameworkProperties="true" /> | ||
| <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" /> | ||
| <PackageReference Include="xunit" Version="2.9.3" /> | ||
| <PackageReference Include="xunit.runner.visualstudio" Version="3.1.4" /> |
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.
Problem
Cancelling a biometric authorization could escape as an exception when the wallet was already unlocked, instead of rejecting the authorization normally. The Android native negative button also completed the prompt task as cancelled rather than returning a rejected result.
Change
OperationCanceledExceptionconsistently asfalseat the existing wallet-authorization boundary, including the already-unlocked path.falsefrom Android's existing biometric negative button.This independent change addresses audit P2-03 only, based on master
623603d634f07eaead14745da87920a356159be0.Validation
git diff --check 623603dpassed during publication preparation.tests/P2-03/AuthorizationCancellation.Tests.csproj, covering locked/unlocked cancellation, rejection, successful authorization in both wallet states, and propagation of unrelated errors. They link the production authorization service and use disposable real Neo wallets, with platform-prompt, MAUI-view and settings doubles.OneGateApp.slnxand retains a non-build/non-output reference toOneGateApp.csproj.dotnet test tests/P2-03/AuthorizationCancellation.Tests.csproj --no-restore --verbosity minimal.ExportWalletPage, and actualSendTransactionPopup; cancellation left export data undisclosed and transfer approval incomplete. No fingerprint match, signature or transaction broadcast occurred.Both platform source snapshots match the complete reviewed diff SHA256
d3be7ee2e10155ade9c8a8969edd074e74d9b0de9668a5b3edc8938bb5ef621b. Both changed production files also match the restored Android build copy byte-for-byte. Fixtures, screenshots and result JSON are not committed.Scope and limits
This fixes the already-unlocked cancellation path. Locked-wallet cancellation and successful authorization are covered by local regression tests, not native cold-start/locked-wallet device-flow checks. iOS native rejection returns a boolean and does not demonstrate Android's prior cancellation exception. No live-wallet signing or transfer was performed.
Screenshots remain outside the repository and have not been uploaded as GitHub assets. Hosted CI results and maintainer approval are not claimed.