Skip to content

Signal: group changes are invisible and a renamed group can keep its old name - #835

Closed
itz4blitz wants to merge 1 commit into
mainfrom
issue/720-signal-group-changes
Closed

itz4blitz wants to merge 1 commit into
mainfrom
issue/720-signal-group-changes

Conversation

@itz4blitz

Copy link
Copy Markdown
Collaborator

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

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

Platforms

  • windows
  • macos
  • linux
  • android
  • ios

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 signal for the rename and the sentence builder, and cargo 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.

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Tiny Code Review

⚠️ Code review unavailable · run

the AI provider rate-limited the request

This is advice, not a gate. Re-run with the agent:review label or a /review comment.

@unRekable unRekable left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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".

Comment thread crates/chatd/src/adapters/signal.rs Outdated
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);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Major: The flag is only ever set, never cleared. If the account is removed and then re-added while connected, the re-add delta has title and description None and left false, the rewrite guarded at line 620 is skipped, and the row stays read-only — chatd then refuses sends with "You can read X but not post in it" (server.rs 1136) until the next reconnect. The reverse also fails: on every reconnect Event::Groups rebuilds the row from a fresh row() and the store upsert sets read_only = excluded.read_only, so a removed group quietly turns writable again after a restart. Clear the flag when the delta puts the account back in after.members (carry that on the event or GroupDelta), and keep the Groups handler from wiping it.

}

/// 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) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Major: The gate this function implements — first snapshot silent, stale or duplicate revisions skipped, a newer revision announced once — has no test. The fake adapter emits GroupChanged directly and never goes through peer()/note_group_change, so only the pure group_delta is covered: flipping <= to < here, or or_insert to insert in groups_changed, would announce connect snapshots or spam a line per group message and no test would fail. Give the fake a revision-aware group command or unit-test the revision bookkeeping directly.

@itz4blitz
itz4blitz force-pushed the issue/720-signal-group-changes branch from 181eeac to dfdc089 Compare November 20, 2026 20:35
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
@itz4blitz

Copy link
Copy Markdown
Collaborator Author

Superseded by and merged in #903 (d387971 — Release 2026-11-20 combined PR).

@itz4blitz itz4blitz closed this Nov 21, 2026
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.

2 participants