Skip to content

Send conversation start links with the encryption of the chat - #2145

Open
YeungKC wants to merge 4 commits into
mainfrom
fix/start-link-encryption
Open

YeungKC wants to merge 4 commits into
mainfrom
fix/start-link-encryption

Conversation

@YeungKC

@YeungKC YeungKC commented Nov 26, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

mixin://conversations/<id>?start=<text> sent the text as PLAIN_TEXT in every chat. It now uses the encryption category of the chat, from the app that is stored at the time of the send.

 openUri(conversations/<id>?start=text)
   selectConversation
   confirm, for links that other apps open
+  category = group ? signal : conversationDao.getEncryptCategory(owner)
-  sendTextMessage(text, plain)
+  sendTextMessage(text, category)
Chat Before After
Contact or group, also a group that a bot owns plain signal
Bot with ENCRYPTED plain encrypted
Other bot, also one whose app is not stored yet plain plain

The send dialog uses the same rule. It differs from a typed message in one case: for a bot whose app is not stored yet, a typed message uses signal. An open chat keeps the app it was opened with, so the link does not read it. The category is read after the confirmation, so a change while the dialog is open counts. The confirmation itself does not change.

A link that is tapped in a chat can open another chat, which removes the tapped message. The send therefore takes the account and the database before it waits, and does not use that context later.

Evidence

  • test/utils/conversation_start_link_test.dart, 9 cases. Before the change, the contact and encrypted bot cases sent plain.
  • Each of these fails without its change: the bot with no stored app, the open chat whose app changed, the group, a change while the dialog is open, a tapped message that is removed (with reads that take longer than a frame, as with the database isolate), and a link before the account is ready.
  • The second commit alone sent nothing in the removed message case. The third commit fixes it.
  • flutter analyze: no issues. flutter test: 516 passed, 13 skipped.
  • Not tested: a signed-in app against the server.

Merge Danger

Door: two-way

Blast Radius: start links only. In contact and group chats they now need the same Signal setup as a typed message.

@YeungKC
YeungKC requested a review from crossle November 26, 2026 05:42
@gaotic

gaotic Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

AI review done for 62544a3 in 11m 25s · 0 comments

Quality: Ready to merge based on code review and local checks covering encryption selection, confirmation timing, and widget disposal. Live delivery against the server was outside this verification.

Role Model Status
Reviewer GPT codex/gpt-6.2-sol · effort high ok
Summary codex/gpt-6.2-sol · effort medium ok

@gaotic gaotic Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

AI review · GPT + Grok · 8e89cc9

Request changes. flutter test --no-pub test/utils/conversation_start_link_test.dart passes, and the relevant provider, conversation-focus, injector, and DAO paths were inspected. The start-link path can select the wrong category for bots when app metadata is missing or stale, so the PR does not reliably meet its stated encryption behavior.

Comment thread lib/utils/uri_utils.dart Resolved

@gaotic gaotic Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

AI review · GPT · d84c0d0

Request changes. All 11 focused URI and start-link tests passed, and targeted Flutter analysis and git diff --check were clean. An additional widget test that updated bot capabilities during confirmation failed.

Comment thread lib/utils/uri_utils.dart Resolved

@gaotic gaotic Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

AI review · GPT · 62544a3

Approve. All 19 focused Flutter tests passed, including the regression for bot capabilities changing while confirmation is open. Targeted Flutter analysis and git diff --check were clean.

This branch has not been deployed

No deployments
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