Skip to content

fix: refresh LINE keys after invalid sender key - #248

Merged
highesttt merged 2 commits into
mainfrom
highest/plat-39021
Sep 28, 2026
Merged

highesttt merged 2 commits into
mainfrom
highest/plat-39021

Conversation

@highesttt

Copy link
Copy Markdown
Collaborator

No description provided.

@indent

indent Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
PR Summary

When LINE rejects a send with TalkException 83 "invalid sender key", the bridge now makes the next Reconnect do full verification and fetch fresh E2EE keys, instead of reusing the rejected key and certificate. The E2EE-specific reconnect state now also survives a bridge restart.

  • markLoggedOutByOtherClientLocked persists ForceFullE2EELogin=true and clears Certificate for invalid-sender-key errors. It sends BAD_CREDENTIALS line-e2ee-key-missing whenever that flag is set, including on the restart path in Connect.
  • An invalid-sender-key response that arrives after the session was already invalidated still upgrades the persisted metadata, but only when it came from the same invalidated access token (tracked in the new invalidatedAccessToken).
  • Connect loads the DB ExportedKeyMap after the secure file, so a stale secure file can no longer override the latest login's key.
  • Adds a sqlite-backed test covering ordinary, invalid-key, late same-token and late stale-token cases, plus a simulated restart.

Issues

All clear! No issues remaining. 🎉

1 issue already resolved
  • After an invalid-sender-key logout, restarting the bridge makes Connect send the generic "another LINE client connected" BAD_CREDENTIALS state instead of line-e2ee-key-missing, even though ForceFullE2EELogin is persisted. Choose the E2EE message based on the persisted flag as well as the error type. (fixed by commit 2ffd154)

CI Checks

All CI checks passed on 2ffd154.

@linear-code

linear-code Bot commented Sep 28, 2026

Copy link
Copy Markdown

PLAT-39021

Comment thread pkg/connector/client.go Outdated
@highesttt
highesttt merged commit a4ce8d2 into main Sep 28, 2026
9 checks passed
@highesttt
highesttt deleted the highest/plat-39021 branch September 28, 2026 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant