Repository navigation
fix(db): dedupe lazy-decrypt-view failure logging across sync cycles (#11500) - #11678
Merged
Merged
Conversation
This was referenced Aug 26, 2026
Collaborator
Author
|
Validated in local merge-train (train tip a3a96af7308584900f0fab3ab4afd8499391230a, boarded #11663 #11664 #11665 #11667 #11668 #11669 #11670 #11678 on .113 /srv/omniroute-train) — typecheck:core, file-size, complexity, cognitive-complexity, changelog-integrity all GREEN. npm run test:unit showed 21 failures across 15 test files, none touching this PR's diff; reproduced identically (same test names, same asserts) on origin/release/v3.8.51 alone with zero PRs boarded (targeted re-run, 21/94 fail, same failure set) — confirmed base-red/environment-load drift per merge-gates.md §3, not introduced by any of the 8 boarded PRs. |
This was referenced Aug 26, 2026
muhamadgalihsaputra
pushed a commit
to niyatna/NiyatnaRoute
that referenced
this pull request
Sep 27, 2026
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.
Refs #11500 (Issue 1 only — the plan-file's Issues 2/3 need a separate scoped design decision and are explicitly out of this PR's scope; Issue 4 was already fixed, no code change needed).
Root cause
The #9927 fix deduped raw
[Encryption] Decryption failed...logging only insidedecryptConnectionFields(). The lazy-decrypt rollout (createLazyRowProxy/createLazyConnectionViewinsrc/lib/db/providers/lazyConnectionView.ts, used bygetProviderConnections()on every CredentialHealth/model-sync cycle) callsdecrypt()directly with no{quiet:true}and no dedup tracking — a fresh Proxy wraps a fresh row object every cycle, so the raw failure line re-fires on every single cycle for the same corrupt/stale-key credential.Fix
New
decryptQuiet()wrapper insrc/lib/db/encryption.tsshares the existingloggedDecryptFailuresSet withdecryptConnectionFields(), keyed by(provider, connectionId, field, ciphertext)so a credential already flagged via either path logs at most once. Wired into bothcreateLazyRowProxyandcreateLazyConnectionView.Regression test
tests/unit/lazy-connection-view-decrypt-dedupe.test.ts— simulates 3 separate sync cycles over the same corrupt credential via both lazy-decrypt entry points; asserts the raw failure line logs exactly once. Passing 2/2.Gates run