Repository navigation
Conversation
Reddit can sync a new chat's members before its chat type, and the skipped batch's projection was dropped, so the room was later built without the user's own join and bridgev2 kicked them. Cache the untyped projection so the batch that sets the type merges onto it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
1 potential issue found:
↑ Select any checkbox above to have Indent auto-fix the issue
All CI checks passed on
Select any unchecked box below to run or rerun that agent. Found issues (1)Full resultsIndent Review Agent
|
| return nil, networkid.PortalKey{}, unbridgeable(err) | ||
| } | ||
| if next.Type == "" { | ||
| // Reddit can send a new chat's members before its type. |
There was a problem hiding this comment.
⚪️ Nit · Cached untyped room state hides typed state saved by another login
previous is only loaded from the saved portal metadata when r.rooms[roomID] == nil. Now that the untyped state is cached here, later incremental syncs keep merging onto the untyped cache even if another login has since created the shared portal (Receiver "") and saved typed meta.State. Those syncs omit the chat type, so each one hits errMissingChatType again and triggers a full snapshot fetch. Before this change the DB projection was used right away. Consider falling back to the saved state when the cached previous.Type == "".
Found by Indent Review Agent
Reddit can sync a new chat's members before its chat type, and the skipped batch's room state was dropped, so the room was built without the user's own join and bridgev2 kicked them. This keeps the merged state cached while the type is missing so the batch that sets it merges onto it.
🤖 Generated with Claude Code