Generalize background→UI session-state broadcasts (sign-out, account-switch, HW-unlock)
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 52/100
- Issue type
- Refactor
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- typescript
- Domain
- authentication, frontend
Research direction
Read the three handler files named in the issue—signOut.ts, makeAccountActive.ts, and confirmPassword.ts—alongside the existing SESSION_LOCKED path from PR #2802. Trace the popup-side reducer handling and SessionEventListener entry point, then run or add tests for sibling-window sign-out, account switching, and HW unlock synchronization.
Written by the indexing model from the issue text.
Description
Follow-up from #2082 (auto-lock UI flip).
Context
PR #2802 introduced a one-off SERVICE_TYPES.SESSION_LOCKED broadcast from background to UI so that idle auto-lock immediately flips all open extension UIs to the unlock screen. Internal review-fix round 1 noted that the same "background mutates session state, but other open UI surfaces stay stale until a pull-based refresh" pattern exists in several other paths:
extension/src/background/messageListener/handlers/signOut.ts— sign-out only reaches the UI that initiated it.extension/src/background/messageListener/handlers/makeAccountActive.ts— active-account changes are returned to the caller only; other open windows (e.g. side panel + standalone signing window) can show a different active account.extension/src/background/messageListener/handlers/confirmPassword.ts— HW unlock updates background session only; sibling windows may stay locked/stale.
What needs to happen
Replace the ad-hoc SESSION_LOCKED broadcast with a small, typed session-event bus:
- Background helper
broadcastSessionEvent({ type: "LOCKED" | "SIGNED_OUT" | "ACTIVE_ACCOUNT_CHANGED" | "UNLOCKED", payload? })wrappingbrowser.runtime.sendMessage(with the existing no-receivers try/catch). - A single popup-side
SessionEventListenercomponent subscribing to those events and dispatching the matching reducer (lockAccount,signOut,switchActiveAccount,refreshAccount). - Migrate the lock path from #2802 onto this bus, and wire the three handler files above into it.
Add tests covering at least:
- sign-out from one open window locks/redirects sibling windows.
- account switch from one open window updates the active account in sibling windows.
- HW unlock updates sibling windows.
Dependencies
- Blocked by none, but should land after the stale-response guard (the other follow-up from #2082) so that hook responses can't race against new broadcasts either.
References
- Parent issue: #2082
- Implementation commits: b00599bc, ecf489b6 (on
plan-do-review/issue-2082for PR #2802) - Identified by: internal review-fix round 1 on PR #2802
- Dominant language
- TypeScript
- Stars
- 122
- Forks
- 62
- Avg merge
- 4d 19h
- Merged PRs (30d)
- 41
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from stellar/freighter
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 2 days
-
Write the banner publishing guidePossibly taken @aristidesstaffieri claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
stellar/freighter#3152 · 1 assignee ·
Maintainers usually reply within 2 days
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 2 days
-
Dont call blockaid on empty token listMay be free again A pull request for this issue was closed without being merged. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 2 days
-
follow-up
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 2 days
All issues in stellar/freighter
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
zabuton-app/meguri#875 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 86/100
iruzen-dono/workless#117 ·
Maintainers usually reply within 1 day
-
area:api area:web wave wave:trivial
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
vetro-protocol/vetro-monorepo#1321 ·
Maintainers usually reply within 1 day