Skip to content

Pocket: skip removed Burrows when enabling push notifications - #1095

Open
dormouse-bot wants to merge 1 commit into
mainfrom
fix/pocket-push-skip-removed
Open

dormouse-bot wants to merge 1 commit into
mainfrom
fix/pocket-push-skip-removed

Conversation

@dormouse-bot

Copy link
Copy Markdown
Collaborator

On Pocket's Burrows view, tapping Enable push notifications fails when the phone still holds a paired record for a Burrow the Relay no longer lists, which is a row showing Removed from your account or No longer enrolled with this Relay. This PR excludes those removed rows from push registration in both places that decide the push targets. A regression test covers it.

The Enable loop and the card's state picked targets with !needsPairing only. A removed row keeps its paired record until the user taps Forget, so it passed that filter. That broke push in two ways:

  • onEnablePush called subscribeToPush for the removed Burrow. Both Relays refuse that with 404 unknown burrow: the self-host one in relay/src/app.ts, and the Hosted one in hosted/server/relay-push.ts. The 404 threw out of the loop, so Burrows after the removed one in the list were never registered, and the user saw an error.
  • pushNoticeState required every id in pairedBurrowIds to be subscribed, and that list included the removed id, which can never be subscribed. The card therefore never reached "Push notifications on." and kept offering an Enable that could only fail.

Both filters now use one predicate, isPushTarget (paired and not removed). docs/specs/pocket-app.md → "Detecting install state, and what cannot be detected" now says the tap registers the paired Burrows the Relay still lists.

The new case in App.push.test.tsx drops burrow-1 from the Relay's list. It asserts that only burrow-2 is registered, that no error shows, and that the card reads on. It fails on main and passes with this change, and the rest of src/remote/pocket-app/ passes too (173 tests).

A Burrow the Relay's list no longer names keeps its paired record until
Forget, so the Enable loop still registered it. Both Relays answer that
pushSubscribe with 404 'unknown burrow', which threw partway through the
loop, and the card counted the removed id among the Burrows that must be
subscribed, so it could never reach 'on'.
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying mouseterm with  Cloudflare Pages  Cloudflare Pages

Latest commit: c8cd7e9
Status: ✅  Deploy successful!
Preview URL: https://8d9c1d16.mouseterm.pages.dev
Branch Preview URL: https://fix-pocket-push-skip-removed.mouseterm.pages.dev

View logs

This branch is waiting to be deployed

1 waiting deployment
hosted-preview — c8cd7e93 Waiting Oct 10, 2026 by dormouse-bot via deploy #1278
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