Repository navigation
Conversation
Tiny Code Reviewthe AI provider rate-limited the request This is advice, not a gate. Re-run with the |
unRekable
left a comment
There was a problem hiding this comment.
Code Review
🟡 2 findings (0 blocking).
The change notices group revisions from presage's stored group (fetched by presage's receive loop before the adapter sees the message) instead of trusting the unsigned change bytes, gates them by revision so the connect snapshot stays silent, and surfaces each change as a system line while taking the new title, description and read-only state into the row. The design holds: snapshots are bounded, the revision bookkeeping is careful, and the fake adapter plus an e2e scenario cover the visible rename. What fails is the read-only bookkeeping around membership, and the revision gate on the real path has no test.
Residual risk
- System-line ids (signal-system-{sent_ms}-{at}) are unique only within one event; two GroupChanged applies in the same wall-clock millisecond would collide and ingest's INSERT OR REPLACE would drop the earlier line. The real adapter cannot do that today — presage's group fetch sits between the two emits — but two steered group-title commands in the fake can, so a future test that steers twice within a millisecond will flake.
- A change made while the account is offline whose message is no longer in Signal's queue (quiet group, long offline) never surfaces: nothing polls group state, so the snapshot and the row title stay old until some later message carries a newer revision.
- If presage's group fetch fails when the change message is processed, the line is silently deferred to the next group message; nothing logs the skip, so a missed rename looks like no rename happened.
- The invited line does not special-case the account itself: an invite aimed at this account prints "You was invited".
| let mut row = row(&peer, &title); | ||
| row.topic = description.unwrap_or_else(|| known.as_ref().map(|row| row.topic.clone()).unwrap_or_default()).chars().take(300).collect(); | ||
| // A later rename does not put a removed member back. | ||
| row.read_only = left || known.as_ref().is_some_and(|row| row.read_only); |
There was a problem hiding this comment.
| } | ||
|
|
||
| /// The stored group moved forward. One system line per change, and the row fields the adapter applies. | ||
| async fn note_group_change(&mut self, id: &str, key: &[u8; 32], revision: u32) { |
There was a problem hiding this comment.
181eeac to
dfdc089
Compare
A newer group revision updates the row and writes one system line per change. The snapshot at connect does not invent lines. Leaving the group marks it read-only. Closes #720
dfdc089 to
4b8c208
Compare
What changed and why
A Signal group change that arrives while you are connected now updates the group and writes one system line per change. A rename takes the new name. Leaving the group marks it read-only and says you are no longer in it. Joining, admin changes, the description, the disappearing-message timer, the invite link, and the group photo each get a line. The snapshot at connect does not invent lines for a group that was already named.
The change is read from the group Signal's library has already stored. The unsigned change attached to the message is not trusted. The first snapshot of a connection is the baseline, so opening the app does not replay old history as new lines.
Type
Platforms
Proof
Scenario: e2e/scenarios/signal-group-rename
Lab run: the lab posts this under
e2e-proof.Tested with
cargo test -p chatd --no-default-features --test signalfor the rename and the sentence builder, andcargo clippy -p chatd --no-default-features --all-targets. The Signal library build typechecks. Not tested against a live Signal account. A rejoin does not clear read-only. A snapshot cannot tell "was removed" from "left", so another member's departure is one line either way. The group photo is a line, not a fetched image. Who made the change is not named.Compatibility
No protocol field was added. The row uses the existing title, topic, and read-only fields. An older shell still shows a system message as a message.
Risk and rollback
A group rename or a departure can be missed or written twice if the stored revision is wrong. If that happens, revert this commit.
Release note
A Signal group rename, and other group changes, now show up while you are connected.