* fix: refetch the open channel after background when its window is deep or was jumped to
* fix: catch up a claimed window instead of replacing it
* fix: bound the deep-window catch-up to what the window can hold
The catch-up merge trims the oldest rows past the window cap, and in a
deep window those are the rows being read — losing them yanked the
scroll. The request is now capped to the window's headroom, and a full
window skips the catch-up; when more arrived than fits, the page
detaches the window and "jump to present" takes over. Adds loader tests
for the replace, catch-up, headroom and full-window cases, and updates
the performance notes.
* fix: refresh the open channel's whole window after a connection break
A window deeper than 70 messages, or one reached by a jump, got no
refresh on resume: new messages, reactions, edits and deletes from the
gap were all missed until the channel was reopened. Tapping a
notification for the open channel did not reopen it, so that could be
a long wait.
The quiet refresh now refetches the window's own span, from its oldest
message up and capped at the window limit, through a new
include_from_message flag on get_newer_messages. The messages being
read are always in the response, so nothing is dropped and the scroll
never moves, at any depth; every loaded message comes back in its
current state, so changes to existing messages land too, and a message
that does not come back is removed. Unchanged messages keep their
objects. This replaces the depth guard and the newer-only catch-up.
* fix: harden the window refresh against reactions, deletes and mid-flight changes
---------
Co-authored-by: Nikhil Kothari <nik.kothari22@live.com>
- always show a notification for pushes on Apple platforms: silent pushes
(including the app-visible skip) burned WebKit's ~3-strike budget and got
subscriptions revoked — most-active users lost notifications first
- handle pushsubscriptionchange: open pages re-mint + resync the token
immediately instead of waiting for the next launch
- store the notification-click URL in the Cache API so it survives the
worker being killed mid-thaw, and take a second look when the first
pull comes back empty (page can wake before the worker stores it)
- sweep read notifications when the worker shows one and on every return
to foreground — push lands seconds after the socket, so the read often
predates the notification
- delete the push token only on an explicit "denied": iOS misreports
permission as "default" in notification-opened windows, which silently
flipped the push toggle off