fix( frontend) :notification permission refresh - #3768
Merged
WillemJiang merged 1 commit intoJun 25, 2026
Conversation
2 tasks
WillemJiang
approved these changes
Jun 25, 2026
yydspanda
pushed a commit
to yydspanda/deer-flow
that referenced
this pull request
Jun 28, 2026
marvin9551
pushed a commit
to marvin9551/deer-flow
that referenced
this pull request
Aug 21, 2026
jihtsan
pushed a commit
to jihtsan/dnx-deer-flow
that referenced
this pull request
Aug 29, 2026
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.
Fixes #3767
Why
Browser notifications could be skipped after a user enabled notification permission in Settings.
The root cause is that
useNotification()stores permission state per hook instance. When Settings requests permission, another hook instance used by the chat/agent page can still hold the stale"default"state and refuse to send notifications until the page is refreshed.There was also a first-notification timing edge case:
lastNotificationTimewas initialized at hook creation time, so a valid notification sent immediately after the hook mounted could be incorrectly throttled.What changed
Notification.permissionbefore deciding whether to send.Surface area
frontend/backend/applanggraph.json, or prompt changedocker/or sandboxed executionskills/backend/pyproject.tomlorfrontend/package.json(say what it buys us)Screenshots / Recording
N/A. This is a notification behavior fix; the visible Settings UI is unchanged.
Bug fix verification
Test path that reproduces the bug:
frontend/tests/unit/core/notification/hooks.test.tsBefore the fix, the notification hook tests fail against the old behavior:
Notification sent too soon;"default"permission after another hook grants browser permission.After the fix, the same tests pass.
Validation
cd frontend && pnpm test tests/unit/core/notification/hooks.test.ts
cd frontend && pnpm typecheck
AI assistance
Tool(s) used: codex
How you used it: AI helps with testing and code review.