Repository navigation
Conversation
…e wire when empty
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Platforms
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:
Messagegainsedited_atandprior_text, both#[serde(default, skip_serializing_if = "Option::is_none")]and capped(
PRIOR_LIMIT, 4 000 characters, cut inMessage::bound). An older frame without thefields 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
bodyJSON whereeditedalready lives, so an older chatd reads a newer store andthe 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.