[PR #3091] [PM-7009] Improved exception messages for the Broadcast Service message callback function #4018

Closed
opened 2025-11-26 23:39:41 -06:00 by GiteaMirror · 0 comments
Owner

Original Pull Request: https://github.com/bitwarden/android/pull/3091

State: closed
Merged: Yes


Type of change

  • Bug fix
  • New feature development
  • Tech debt (refactoring, code cleanup, dependency upgrades, etc)
  • Build/deploy pipeline (DevOps)
  • Other

Objective

When exceptions occur inside the lambda for the BroadcastService Callback in App.xaml.cs they can be difficult to read or incomplete.
The idea is to try to make them a bit more clear when looking at AppCenter diagnostics.

Code changes

One potential way to improve them was to change the callback to be a named method instead off a lambda.
Also all the MainThread Invoke inside this callback were changed to have local functions instead of lambdas.

As an example a stacktrace that looked like this:
at Bit.App.App.<>c__DisplayClass28_0.<<-ctor>b__2>d.MoveNext(
Now looks like this:
at Bit.App.App.<>c__DisplayClass29_0.<<BroadcastServiceMessageCallbackAsync>g__ExecuteNavigationAction|0>d.MoveNext(

  • App.xaml.cs:

Screenshots

Before you submit

  • Please check for formatting errors (dotnet format --verify-no-changes) (required)
  • Please add unit tests where it makes sense to do so (encouraged but not required)
  • If this change requires a documentation update - notify the documentation team
  • If this change has particular deployment requirements - notify the DevOps team
**Original Pull Request:** https://github.com/bitwarden/android/pull/3091 **State:** closed **Merged:** Yes --- ## Type of change - [ ] Bug fix - [ ] New feature development - [x] Tech debt (refactoring, code cleanup, dependency upgrades, etc) - [ ] Build/deploy pipeline (DevOps) - [ ] Other ## Objective When exceptions occur inside the lambda for the BroadcastService Callback in `App.xaml.cs` they can be difficult to read or incomplete. The idea is to try to make them a bit more clear when looking at AppCenter diagnostics. ## Code changes One potential way to improve them was to change the callback to be a named method instead off a lambda. Also all the `MainThread` Invoke inside this callback were changed to have local functions instead of lambdas. As an example a stacktrace that looked like this: `at Bit.App.App.<>c__DisplayClass28_0.<<-ctor>b__2>d.MoveNext(` Now looks like this: `at Bit.App.App.<>c__DisplayClass29_0.<<BroadcastServiceMessageCallbackAsync>g__ExecuteNavigationAction|0>d.MoveNext(` * **App.xaml.cs:** ## Screenshots <!--Required for any UI changes. Delete if not applicable--> ## Before you submit - Please check for formatting errors (`dotnet format --verify-no-changes`) (required) - Please add **unit tests** where it makes sense to do so (encouraged but not required) - If this change requires a **documentation update** - notify the documentation team - If this change has particular **deployment requirements** - notify the DevOps team
GiteaMirror added the pull-request label 2025-11-26 23:39:41 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#4018