Skip to content

Show when a message was edited and keep what it said before (stage 1) - #902

Draft
unRekable wants to merge 4 commits into
mainfrom
draft/762-edited-badge
Draft

unRekable wants to merge 4 commits into
mainfrom
draft/762-edited-badge

Conversation

@unRekable

Copy link
Copy Markdown
Collaborator

What changed and why

An edited message now says when it was edited and keeps the one text it had before. The
networks that already deliver edits — Signal, Discord, Slack, Telegram, Teams, Tiny — hand
over their edit time, the store keeps it and one capped snapshot of the words an edit
replaced (the replace used to drop both), and the "(edited)" mark shows the full time on
hover. Google Messages has no edit events and stays without the mark, as today. A full
revisions viewer for Signal's history is a later stage (#762's second half).

Type

  • feature
  • fix
  • perf
  • refactor
  • chore
  • docs

Platforms

  • windows
  • macos
  • linux
  • android
  • ios

The code compiles for the phones through the shared crates; the proof build does not run
desktop chatd, as in the other adapter scenarios.

Proof

Scenario: e2e/scenarios/telegram-edited

Lab run:

Compatibility

The protocol only grew: Message gains edited_at and prior_text, both
#[serde(default, skip_serializing_if = "Option::is_none")] and capped
(PRIOR_LIMIT, 4 000 characters, cut in Message::bound). An older frame without the
fields still reads (the wire test now proves it), an older shell ignores them, and a plain
message carries neither on the wire. The store needs no migration: both fields ride the
row's body JSON where edited already lives, so an older chatd reads a newer store and
the other way round.

Risk and rollback

Worst case is cosmetic: a tooltip reads wrong, or a prior text is a stale one — revert
this pull request and the store row simply stops carrying the fields (they live only in
the JSON body, so no schema to undo). Keeping one superseded text per edited row is a
small retention choice; it is capped, it dies with the row, and a setting or a wipe for it
can ride the follow-up that adds the revisions viewer. Signal's edit time comes from the
edit envelope's own timestamp; if a build of the Signal stack reports a coarse one, the
mark still reads "(edited)" without the hover words.

Release note

An edited message shows when it was edited, and the row keeps what it said before.

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