Skip to content

Open the message a push is about, and show unread from while you were away (GRYT-1976) - #462

Merged
grytchat merged 1 commit into
mainfrom
claude/GRYT-1976-push-target-unread
Oct 31, 2026
Merged

grytchat merged 1 commit into
mainfrom
claude/GRYT-1976-push-target-unread

Conversation

@grytchat

Copy link
Copy Markdown
Contributor

Two bugs from the production phone app.

Tapping a push only opened the server. The guess was that the target gets lost while connecting. It doesn't: the push never had one, only a server tag and the sealed text. The server half is Gryt-chat/server#351. It adds the conversation and message to the seal, and this PR opens them. A push from an older server has neither and stops at the server, as it does now.

No badge on channels. The pill was there, but counting started when the phone connected, so anything that came in while it was away never showed. The server has had read markers for this, and the phone never used them. It now asks for read:list on connect and sends read:set when you open a channel, when a message lands in the open channel, and on mark as read. That also means reading on the phone clears the desktop's count.

Look at:

  • read:list replaces the phone's own counts for every channel with a marker. The channel on screen is skipped and its marker moved instead, or an open channel would show a badge.
  • The jump to a message now waits for the first page. Before that, a jump from cached rows got cancelled when the page arrived and showed "further back than what's loaded".
  • PushTaps goes back to the tabs and then pushes, because dismissTo can't reach a DM's route on the Messages tab. Tapping a push for the DM you already have open on that tab probably stacks a second copy, so back shows it again.

Tested on an iPhone 17 Pro Max simulator against a local build of the server PR, with the server's own sealPreview and simctl push:

  • Badges after being away: General 2, Random 9+.
  • Cold start with the server frozen: the tap opened #Random, and after unfreezing it scrolled to the message.
  • Warm tap to a message outside the first page: it loaded around that message and showed it.
  • Opening a channel moved the marker in the database.

Not verified:

  • A real push through Apple and the relay. The simulator has no token, so the push state was patched for the test (not in this PR).
  • The notification extension on a device, which leaves p in the payload as far as the code shows.
  • Android. Its task now keeps p on the local notification, covered by reading only.
  • A real DM. The tap reached the conversation route and the screen mounted, but my test DM wasn't in the server's list, so conversationIsGone closed it. A real one should stay open, since that check waits for the list to load.
  • Thread replies while away still only count once connected, because the server's counts leave threads out.

Channels you've never opened still get no badge, on the desktop too: GRYT-1977.

GRYT-1976

🤖 Generated with Claude Code

… away (GRYT-1976)

A tap now opens the conversation and message sealed into the push. A push
from an older server has neither and still stops at the server.

Unread counts only started when the phone connected, so anything that came in
while it was away never got a badge. The phone now asks for read:list and sends
read:set, as the desktop does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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