Skip to content

feat!: Add exception to onVerificationFailed callback, improve error handling, add API Guard to CI#20

Merged
flxapps merged 25 commits intodevfrom
feat/add-exception-to-verification-failed-callback
Feb 28, 2026
Merged

feat!: Add exception to onVerificationFailed callback, improve error handling, add API Guard to CI#20
flxapps merged 25 commits intodevfrom
feat/add-exception-to-verification-failed-callback

Conversation

@flxapps
Copy link
Copy Markdown

@flxapps flxapps commented Oct 7, 2025

This PR enhances error handling by adding an optional SecReaderException parameter to the onVerificationFailed callback in SecWidget and SecModalBuilder. This provides developers with detailed information about why a verification process failed, enabling more specific error handling.

Changes include:

  • Updated the onVerificationFailed callback signature across SecWidget, SecModalBuilder, the example app, and tests.
  • Propagated the SecReaderException from the underlying logic to the UI layer.
  • Updated the README.md to document the new callback parameter and explain its usage.
  • Add M-Trust API Guard to CI
  • Refactor error handling

Breaking Changes

⚠️ This is a breaking change

All consumers must update their onVerificationFailed callback:

Before:

onVerificationFailed: () {
  print('Identification failed');
}

After:

onVerificationFailed: (exception) {
  print('Verification failed: ${exception.message}');
}

@flxapps flxapps self-assigned this Oct 7, 2025
@flxapps flxapps changed the base branch from main to dev October 7, 2025 10:41
@flxapps flxapps force-pushed the feat/add-exception-to-verification-failed-callback branch from 06d5ee3 to 58df0c4 Compare October 7, 2025 11:03
Copilot AI review requested due to automatic review settings October 7, 2025 11:03
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds propagation of SecReaderException to onVerificationFailed callbacks to improve error diagnostics and handling across SecWidget and SecModalBuilder.

  • Passes exception details from lower layers to UI callbacks.
  • Introduces SecResultFailed.exception and updates example, README, and tests to new signatures.

Reviewed Changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
lib/src/ui/sec_widget.dart Adds exception-typed onVerificationFailed and forwards exception; updates button handler and child callback wiring.
lib/src/ui/sec_modal.dart Makes onVerificationFailed accept exception; adds SecResultFailed(exception) and forwards it through modal result.
lib/src/ui/scanning_view.dart Forwards underlying exception to onVerificationFailed; updates button handler.
test/sec_widget_test.dart Adjusts tests to new callback arity.
example/lib/main.dart Updates example to log received exception; minor import reorder.
README.md Documents the new exception parameter for onVerificationFailed.

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@flxapps flxapps force-pushed the feat/add-exception-to-verification-failed-callback branch from 1975d58 to e562c72 Compare October 7, 2025 11:43
@flxapps flxapps requested a review from ElectricCookie October 7, 2025 12:34
@flxapps flxapps changed the title feat: Add exception to onVerificationFailed callback feat!: Add exception to onVerificationFailed callback Oct 8, 2025
Copy link
Copy Markdown
Collaborator

@ElectricCookie ElectricCookie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a test using virtual strategy to simulate the error being thrown and correctly passed back to the widget

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 47 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 47 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@flxapps flxapps requested a review from Copilot February 16, 2026 10:22
@flxapps flxapps changed the title feat!: Add exception to onVerificationFailed callback feat!: Add exception to onVerificationFailed callback, improve error handling, add API Guard to CI Feb 16, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 52 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@flxapps flxapps force-pushed the feat/add-exception-to-verification-failed-callback branch from aee99ff to fe39270 Compare February 16, 2026 11:58
@flxapps flxapps requested a review from Copilot February 16, 2026 12:32
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 55 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@flxapps flxapps force-pushed the feat/add-exception-to-verification-failed-callback branch 2 times, most recently from b7f695c to c5dc7c8 Compare February 16, 2026 14:00
Previously, non-DeviceError exceptions were swallowed and null was
returned, hiding failures from callers. Now all unexpected exceptions
propagate. Return type changed to non-nullable UrpSecPrimeResponse
since all code paths now either return a value or throw.
DeviceErrors that propagate through SECReader are now caught by
_SecExceptionMapper, producing a user-friendly LdException with
retry support. This keeps SECReader transparent while ensuring the
widget UI handles all error types consistently.
@flxapps flxapps force-pushed the feat/add-exception-to-verification-failed-callback branch from 9db24ea to ab1263f Compare February 16, 2026 14:29
@github-actions
Copy link
Copy Markdown

Version Analysis

Next Version: 3.0.0-dev.1

Changelog: 📄 View detailed changelog in job summary

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 54 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link
Copy Markdown

Version Analysis

Next Version: 3.0.0-dev.1

Changelog: 📄 View detailed changelog in job summary

@github-actions
Copy link
Copy Markdown

Version Analysis

Next Version: 3.0.0-4

Changelog: 📄 View detailed changelog in job summary

Badge:
Version Badge

@github-actions
Copy link
Copy Markdown

Version Analysis

Next Version: 3.0.0-4

Changelog: 📄 View detailed changelog in job summary

Badge:
Version Badge

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 54 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ElectricCookie
Copy link
Copy Markdown
Collaborator

LGTM requesting Review from Josh too to make sure he's in the loop

Copy link
Copy Markdown
Collaborator

@JoshuaWell JoshuaWell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM as well :)

@flxapps flxapps merged commit 422d320 into dev Feb 28, 2026
9 checks passed
@flxapps flxapps deleted the feat/add-exception-to-verification-failed-callback branch February 28, 2026 10:51
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.

4 participants