Skip to content

feat(sync): approved devices tell the person when another device asks for the account's keys - #4751

Merged
datlechin merged 2 commits into
mainfrom
feat/approval-request-notice
Nov 30, 2026
Merged

datlechin merged 2 commits into
mainfrom
feat/approval-request-notice

Conversation

@datlechin

Copy link
Copy Markdown
Member

Summary

  • core: after each pass the service engine raises keys_changed when the open approval requests change, including a launch's first pass that finds one (core ADR 0109, amends 0056). No new listener method, no polling in the apps.
  • core/FFI: ApprovalRequest and ApprovalRequestInfo carry expires_at_us. C# bindings regenerated.
  • macOS: ApprovalRequestNotifier tells each request once: a notification while TablePro is in the background and Settings > Notifications is on, an alert with Approve… and Not Now while it is in front, nothing while End-to-End Encryption is on screen. One prompt at a time.
  • macOS: the notice names the device, its platform and when it asked, never the words.
  • macOS: a click or Approve… opens End-to-End Encryption and the request's approval once the page lists it; one asked for behind another sheet waits for it to close.
  • macOS: a notice goes once its request is approved, refused, taken by another device or expired, and on a sign-in change. Notifications an earlier run left follow the list at launch.
  • macOS: the Notifications pane's description names device requests.
  • Windows: the same rules in ApprovalRequestNotices (App.Model): an app notification through the Windows App SDK while away, a bar on the window in use while in front, the review on the End-to-end encryption page.
  • Windows: the Settings > Notifications switch reads Show notifications and covers device requests, as on macOS.
  • Windows: a PC with TablePro Sync off hears requests once its service runs; feat(windows): the sync service opens at launch for every signed-in account #4735 opens it at launch for every signed-in account.
  • iOS: no change. It offers Off and iCloud only and opens no key flows, so it never approves a device.
  • Tests changed on purpose: FakeAccountKeyFlows.request, KeyFlowTests and the notification presenter fakes take the new field and deliveredIdentifiers().

Screenshots

Approval alert while TablePro is in front (light, dark):

Approval alert, light
Approval alert, dark

Settings > Notifications. Before, the description ended at "or an extension can't load or update."

Notifications pane, light
Notifications pane, dark

The alert and pane are the app's own views rendered in a throwaway hosted test. A system notification and the Windows bar need a live request from another device, so they have no shot.

Test plan

  • core: a_request_waiting_for_approval_reaches_the_app_as_a_key_change_and_so_does_its_end and a_request_the_first_pass_finds_reaches_the_app_and_none_found_says_nothing fail on main; the_approver_lists_a_request_with_the_row_that_wrote_it checks the expiry. cargo test -p tablepro-sync --test engine 168 passed, --test device_flows approval 43 passed, -p tablepro-ffi --lib sync passed, cargo clippy -p tablepro-sync -p tablepro-sync-testing -p tablepro-ffi --all-targets -D warnings clean, cargo fmt --check clean.
  • macOS: verify.sh test of ApprovalRequestNotifierTests, AccountKeysModelTests, AccountApprovalFlowTests, AccountKeysScreenTests and the notification suites: PASS, 90 executed. verify.sh lint PASS, verify.sh l10n PASS.
  • Windows: bindings regenerated with no diff; verify.sh --platform windows build PASS; test TablePro.App.Model.Tests PASS, 1361 executed; test TablePro.Interop.Tests PASS, 242 executed. The WinUI app and its UI tests run in this PR's Windows CI.
  • Review: Codex, three rounds (review and security together); every finding fixed except the sync-off case above.

…-notice

# Conflicts:
#	apple/TablePro/Views/Sync/Keys/AccountKeysModel.swift
#	core/docs/decisions/README.md
#	windows/src/TablePro.App.Model/AccountKeysPage.cs
@datlechin
datlechin merged commit 12b97f9 into main Nov 30, 2026
1 check passed
@datlechin
datlechin deleted the feat/approval-request-notice branch November 30, 2026 04:38
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.

1 participant