fix(watchsync): persist per-connection plugin config for later RPCs - #718
Closed
cursor[bot] wants to merge 3 commits into
Closed
fix(watchsync): persist per-connection plugin config for later RPCs#718cursor[bot] wants to merge 3 commits into
cursor[bot] wants to merge 3 commits into
Conversation
ExchangeAPIKey merged a profile's server URL and secrets into ProviderConfig, then dropped them. Later sync, refresh, scrobble, and export used only the installation-wide config, so a household member's personal server was ignored after connect. Store the overlay in the encrypted plugin credential bundle and merge it on every authenticated plugin RPC. Co-authored-by: Quick <Quick104@users.noreply.github.com>
Quick104
force-pushed
the
cursor/critical-bug-management-035f
branch
from
August 26, 2026 03:28
50b286a to
6b82ca2
Compare
Quick104
marked this pull request as ready for review
August 26, 2026 13:38
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6b82ca211a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Related issue: N/A — regression in #550
Connecting a plugin watch provider with a profile-specific server URL or secret only applied those values to
ExchangeAPIKey. Scheduled sync, token refresh, scrobble, and export then sent the installation-wideProviderConfig.The initial patch persisted that per-connection overlay, but review found follow-on hazards:
Approach
plugin_credentialsbundle and merge it over installation config for every authenticated plugin RPC.credential_revisionas a credential/config-specific concurrency fence. Plugin-returned rotations update only the encrypted credential fields with a database compare-and-swap; connect/reconnect advances the revision and replaces the complete overlay, including clearing obsolete values.Connections created before this fix keep using installation-wide config until they are reconnected.
Validation
Passed locally:
A fresh PostgreSQL 18 database passed all migrations, the database-backed reconnect/rotation/legacy-writer test, and an explicit down/up cycle for
20260826032121_add_watch_provider_credential_revision.sql. The test covers stale rotation, account identity, concurrent diagnostics, old update fencing, and delete-then-old-insert fencing.make test-goreached the full tree. Every changedwatchsyncpackage passed; two unrelated, environment-reproducible process-identity tests ininternal/jellycompatfailed on this Mac.Risks
bigint, a small trigger function, and two triggers. Existing plugin rows start at revision0and advance on their next reconnect or credential rotation.40001if they try to insert a plugin connection or rewrite plugin account/credential fields. This intentionally favors credential correctness over transient old-replica availability.AI Disclosure
Checklist