Skip to content

connector: don't ask for a reconnect when only retired E2EE keys are missing - #309

Merged
highesttt merged 1 commit into
mainfrom
indent/line-retired-e2ee-key-prompt
Nov 6, 2026
Merged

highesttt merged 1 commit into
mainfrom
indent/line-retired-e2ee-key-prompt

Conversation

@indent

@indent indent Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Fixes PLAT-40140

Logs (prod, line a9cefaf): From Nov 3 to Nov 6, 12 accounts went CONNECTED → BAD_CREDENTIALS line-e2ee-key-missing within 5-60 s of logging in. Six of them had just done a full PIN login. Each one unwrapped group keys with its new key, then got flagged for missing my private key for <id>. In every case that ID was older than the new key: the recent-message backfill was hitting history encrypted to the user's previous keys. Five of those users redid the PIN login for nothing. One still shows the reconnect prompt.

Cause: markMissingE2EEKey treats every ErrMissingOwnPrivateKey as stale credentials. LINE key IDs increase over time, and LoadMyKeyFromSecureData already relies on that. A missing own key below myRawKeyID is a retired key that no relogin returns. Only a newer missing key means the login's keys are stale.

Change: pkg/e2ee now returns a typed MissingOwnKeyError{KeyID} (it wraps ErrMissingOwnPrivateKey and keeps the same text). markMissingE2EEKey skips the reconnect flag when that key ID is lower than the current own key. Those messages still show as undecryptable. Stale preserved-key re-logins that miss a newer key are still flagged.

go build ./..., go vet and the existing tests in pkg/e2ee and pkg/connector pass.

View in Indent
Tag @indent to continue the conversation here.

@indent

indent Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor Author

Issues

No issues found.

CI Checks

All CI checks passed on 927a48f.

Review agents

Select any unchecked box below to run or rerun that agent.

Passed (1)
  • Indent Review Agent · No issues found in the retired-key check.
Full results

Indent Review Agent

  • Summary: No issues found in the retired-key check.
  • Last ran on commit: 927a48fa
  • Latest result
    {
      "summary": "No issues found in the retired-key check.",
      "findings": []
    }

@indent indent Bot added the to be tested label Nov 6, 2026
@iFixRobots
iFixRobots requested a review from highesttt November 6, 2026 14:56
@highesttt
highesttt merged commit ae61689 into main Nov 6, 2026
9 checks passed
@highesttt
highesttt deleted the indent/line-retired-e2ee-key-prompt branch November 6, 2026 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants