Skip to content

muse: resync regular_high when a Muse reply's root secret is missing - #1060

Closed
iFixRobots wants to merge 2 commits into
mainfrom
iFixRobots/muse-refetch-missing-root-secret
Closed

iFixRobots wants to merge 2 commits into
mainfrom
iFixRobots/muse-refetch-missing-root-secret

Conversation

@iFixRobots

@iFixRobots iFixRobots commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Muse replies are msmsg encrypted with the WASA root secret, and we only fetch regular_high for it once per login (resyncWASARootSecrets). If that sync misses it, every Muse reply fails forever:

Error decrypting message 3EB07236A2087F0C31DEA4 from 1807055946647697@bot: message secret for AC9BA57ECE74764B73851B76F03268CC not found

On an undecryptable Muse message whose target secret isn't stored, this does a regular_high full sync under wasaResyncLock, gated by the existing appStateFullSyncAttempted 48h window. If the full sync fails, the existing AppStateSyncError handler asks the phone for recovery, which stores the secret.

Before / after

Tested on a live account (root secret row deleted after sending a prompt).

Case Base Head
Muse reply, secret missing every part an undecryptable notice, no refetch first part a notice; full sync → phone recovery restores the secret 0.3 s later; rest of the reply decrypts
Next prompt secret still missing, nothing refetches it reply decrypts

Linear: https://linear.app/beeper/issue/PLAT-40565

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

@indent

indent Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Issues

All clear! No issues remaining. 🎉

1 issue already resolved
  • resyncMissingMuseSecret rate-limits only via appStateFullSyncAttempted[regular_high], but a successful full FetchAppState dispatches AppStateSyncComplete, whose handler deletes that entry. If the sync succeeds yet the secret is still missing, every following undecryptable Muse message runs another full regular_high sync. Use a separate throttle (e.g. a dedicated timestamp or a set of tried TargetIDs) that sync completion doesn't clear. (fixed by commit f92f8d6)
    Found by Indent Review Agent

CI Checks

All required CI checks passed on f92f8d6.

Review agents

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

Passed (1)
  • Indent Review Agent · No issues found in the Muse secret resync
Full results

Indent Review Agent

  • Summary: No issues found in the Muse secret resync
  • Last ran on commit: f92f8d6e
  • Latest result
    {
      "summary": "No issues found in the Muse secret resync",
      "findings": []
    }

Comment thread pkg/connector/muse.go Resolved
@indent
indent Bot requested a review from tulir November 16, 2026 13:08
@iFixRobots iFixRobots closed this Nov 18, 2026
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