Skip to content

Message buffer ordering and dedup #34

Description

@zealsprince

The parsing half exists: incoming messages already extract msgid and server-time into the message struct. Two gaps. First, both fields are unwrapped with .expect("unimplemented"), so any line without them (presence events, older servers) hits a panic path. Second, nothing uses them: the buffer appends in arrival order and nothing dedupes.

Key the buffer by msgid and sort by server-time. Live delivery, echo-message self-copies, and chathistory replays of the same message merge into one record; keyless lines collapse by the synthetic signature from the cache spec's dedup rules, which apply to the in-memory buffer the same way.

Spec

Acceptance criteria

  • A message seen live and again in a replay renders once
  • The sender's echo-message copy merges with the locally rendered send
  • Lines without msgid or server-time neither panic nor duplicate; they collapse by the type + author + text + time signature
  • An old-stamped line arriving live (event-playback) inserts at its server-time position, not the tail
  • This goes hand-in-hand with Chathistory seeding and scroll-back paging #33 from a testing perspective since we should be able to POC this feature there without building a separate test-fixture

Out of scope

No blockers. Rich messaging (#7) assumes this is in place.

Metadata

Metadata

Assignees

Labels

uplinkThe IRC layer: protocol, caps, messaging, metadata

Fields

Start date

None yet

Target date

None yet

Size

None yet

Projects

Status
In review

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions