Skip to content

handle*: bridge marking chats as unread - #167

Merged
iFixRobots merged 5 commits into
mainfrom
iFixRobots/mark-unread
Nov 26, 2026
Merged

iFixRobots merged 5 commits into
mainfrom
iFixRobots/mark-unread

Conversation

@iFixRobots

@iFixRobots iFixRobots commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Marking a chat as unread didn't carry over in either direction. Slack has no unread flag: "Mark unread" in the web client just calls conversations.mark with the timestamp of the message before the one you picked, so the read marker moves backwards. The bridge turned that channel_marked/im_marked into a read receipt on an older message, which Matrix ignores, and it didn't implement MarkedUnreadHandlingNetworkAPI at all.

Now a marked event that moves the cached last read backwards is bridged as RemoteEventMarkUnread. From Matrix, m.marked_unread marks the conversation at the second newest message (same as the web client), and clearing it marks the newest one read. Matrix read receipts no longer move Slack's marker backwards, so they can't be mistaken for "mark unread". Room features now advertise mark_as_unread.

Before / after

Same DM, main vs this branch:

main this branch
Mark unread on Slack m.marked_unread stays false m.marked_unread: true
Read again on Slack no change back to false
m.marked_unread: true from Matrix ignored, Slack stays read Slack shows the last message unread
m.marked_unread: false from Matrix ignored Slack marked read

In Beeper cloud, Slack → Matrix unread doesn't take effect yet: bridgev2's ASIntent.MarkUnread returns early when the homeserver is hungryserv, so it needs bridgev2/hungryserv support there. Matrix → Slack depends on the homeserver delivering m.marked_unread to the bridge.

View in Indent
Tag @indent to continue the conversation here.

@indent

indent Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Issues

All clear! No issues remaining. 🎉

1 issue already resolved
  • When m.marked_unread is cleared, HandleMarkedUnread fetches Slack's live conversations.history and marks Messages[0] read whenever the cached lastRead is older. That marker comes from Slack, not from anything the user saw in Matrix. So Slack messages not yet bridged or seen get marked read, and toggling unread on and off wipes real Slack unreads that the unread path deliberately left alone. (fixed by commit e69052f)
    Found by Indent Review Agent

CI Checks

All required CI checks passed on c0667ad.

Review agents

Select any unchecked box below to run or rerun that agent.

Passed (1)
  • Indent Review Agent · No issues found in mark-unread bridging
Full results

Indent Review Agent

  • Summary: No issues found in mark-unread bridging
  • Last ran on commit: c0667ad2
  • Latest result
    {
      "summary": "No issues found in mark-unread bridging",
      "findings": []
    }

Comment thread pkg/connector/handlematrix.go Resolved
@iFixRobots
iFixRobots requested a review from tulir November 9, 2026 00:15
@tulir tulir changed the title connector: bridge marking chats as unread handle*: bridge marking chats as unread Nov 9, 2026
@indent indent Bot unassigned tulir Nov 16, 2026
# Conflicts:
#	pkg/connector/handlematrix.go
#	pkg/connector/handleslack.go
@iFixRobots
iFixRobots merged commit 7a91968 into main Nov 26, 2026
10 of 12 checks passed
@iFixRobots
iFixRobots deleted the iFixRobots/mark-unread branch November 26, 2026 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants