Skip to content

Improve polling reliability and notification open flow - #6

Merged
0x2E merged 2 commits into
mainfrom
improve/reliability-and-polling
Aug 16, 2026
Merged

0x2E merged 2 commits into
mainfrom
improve/reliability-and-polling

Conversation

@0x2E

@0x2E 0x2E commented Aug 16, 2026

Copy link
Copy Markdown
Owner

Summary

  • Retry notification polling with backoff instead of stopping after 3 failures, and honor GitHub’s X-Poll-Interval (minimum 60s).
  • Send If-None-Match on the inbox request so unchanged lists can return 304 and skip the rate-limit budget.
  • Opening a notification marks the thread as read, removes it locally, and updates the menu bar count immediately.
  • Token stays in UserDefaults, but is saved on verify/leave instead of every keystroke. Settings is a single Window, with launch-at-login.
  • Shared state uses @Observable; avatars request a 40px image via AsyncImage; user-facing API errors no longer dump response bodies.
  • Add a unit-test target and a shared scheme for date/URL/referrer/poll-timing helpers.

Test plan

  • Launch without a token and confirm the settings prompt still appears.
  • Save/verify a token from Settings and confirm polling starts only after save, not while typing.
  • Confirm a successful refresh shows a relative “Updated …” subtitle and the menu bar count.
  • Disconnect the network, wait through a few retries, and confirm the loop keeps going (no permanent stop) and existing items stay visible.
  • Click a notification: browser opens, the row disappears, menu bar count decreases; after refresh it stays gone if GitHub marked it read.
  • Toggle Launch at login and reopen Settings to confirm the toggle persisted.
  • Run GitStatus tests in Xcode (GitStatus scheme).

0x2E added 2 commits August 16, 2026 13:46
Keep retrying after transient GitHub failures with backoff, send
If-None-Match so unchanged inboxes can 304, and mark a thread as
read when it is opened. Also stop writing the token on every
keystroke, switch shared state to Observable, and add unit tests
for the pure helpers.
Keep opened threads dismissed across in-flight list refreshes, stop
retrying on 401, persist a token only after a successful verify, and
avoid treating failed pulls as a successful lastPull.
@0x2E

0x2E commented Aug 16, 2026

Copy link
Copy Markdown
Owner Author

Independent review findings were checked against the code. Accepted and fixed:

  • Optimistic local dismiss now survives an in-flight GET /notifications
  • lastPull only updates on 200/304
  • Token changes reset serverPollInterval
  • 401 stops the poll loop; retry delay is floored at 60s
  • Verify tests the draft and saves only on success
  • Avatar default size is 64px
  • Periodic 304/failed pulls no longer clear the Load more spinner
  • Failed mark-as-read reinserts by updatedAt

Left as-is: settings debounce, relative-time ticking, and first-click referrer before /user returns. Those are nits, not correctness bugs.

@0x2E
0x2E merged commit 5cefd05 into main Aug 16, 2026
@0x2E
0x2E deleted the improve/reliability-and-polling branch August 16, 2026 06:10
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