Repository navigation
[flutter_local_notifications_windows] recover from a disconnected notifier instead of terminating the app #2850
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
DavidClaudeAI
wants to merge
3
commits into
MaikuB:master
Choose a base branch
from
DavidClaudeAI:fix/windows-stale-notifier
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
eda4ba1
[flutter_local_notifications_windows] recover from a disconnected not…
DavidClaudeAI dd27434
[flutter_local_notifications_windows] guard init and per-tag parsing,…
DavidClaudeAI 2ccc046
[flutter_local_notifications_windows] skip a tag that is only partly …
DavidClaudeAI File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know the plugin wasn't doing this before but is there an opportunity for it to catch an exception that can be propagated on the Dart so it can be caught by apps and dealt with appropriately? This is a general question btw so applies to the next catch block below too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's possible. An exception can't cross the FFI boundary, but the native side can keep the failure and the Dart side can throw it. Roughly:
withHandlesstores the error (HRESULT and message) in the plugin instead of only returningfalse;WindowsNotificationExceptionwithcodeandmessage) whenever a native call returnsfalse;showRawXmlwould no longer report a platform failure as invalid XML, andzonedSchedule/zonedScheduleRawXmlwould no longer complete silently when nothing was scheduled. A failedinitialize()could become retryable at the same time.It does change behaviour: calls such as
cancelAll, which used to either succeed or terminate the app, would now throw, so apps may need atry/catch. Would you rather have it in this PR, or keep this one as the crash fix for the 22.x hotfix and do the error propagation in a follow-up PR onmaster? Either way I'll fix thestd::stoiprefix issue Copilot found here.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the info, it can be done in a follow up PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I'll do it in a follow-up PR on
masteronce this one is merged.The
std::stoiissue Copilot raised is fixed in 2ccc046: the tag is now parsed withstd::from_charsand kept only when every character was consumed, so a tag such as12abcis skipped instead of being listed as ID 12. Tags written by the plugin still parse, negative IDs included.