fix(sync): sync WebDAV server URL for configured-but-disabled providers (#5141) - #5149
Merged
Conversation
…rs (#5141) Credential connection metadata (webdav.serverUrl/rootPath and the kosync/readwise/s3 equivalents) is plaintext and was tracked by the in-memory lastPublishedFields snapshot, which initSettingsSync seeds from disk at boot. Any such value already on disk is therefore treated as "already published" and never sent again. The encrypted credential fields (username/password) instead use a persisted push-hash, so a value with no stored hash is treated as never-published and IS sent on the next save. When WebDAV was configured before serverUrl entered the sync whitelist (#4810) or before localStorage recorded a push, the boot seeding stranded serverUrl/rootPath while the credentials synced normally: the other device received username/password but not the server address. Track the connection metadata with the same persisted push-hash used by the encrypted fields instead of the disk-seeded snapshot, so a never-published URL publishes on the next save and rejoins its credentials. Empty values stay local, mirroring the encrypted-field rule. Structural settings keep the disk-seeded clobber protection. Also give DaisyUI checkboxes a crisp 1px base-content border on e-ink so a configured-but-disabled cloud sync provider's enable box stays visible on grayscale panels. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Fixes #5141.
Problem
Two issues from the report:
Root cause (sync)
In
replicaSettingsSync.ts, plaintext and encrypted whitelisted settings used two different "was this already published?" trackers, and they diverge:webdav.serverUrl/rootPathdiff against an in-memory snapshot thatinitSettingsSyncseeds from disk at boot, so any value already on disk is treated as already-published and never sent again unless it changes.webdav.username/passworduse a persisted push-hash, so a value with no stored hash is treated as never-published and is sent on the next save.When WebDAV was configured before
webdav.*entered the sync whitelist (#4810) — or before localStorage recorded a push — the boot seeding strandedserverUrl/rootPathwhile the credentials synced normally. The peer received username/password but not the server address, exactly as reported. A fresh Connect always worked because there the URL goes from empty to set while the app runs, so it diffs.Fix
webdav.serverUrl/rootPathplus the kosync/readwise/s3 equivalents, derived as "whitelisted, not encrypted, sharing a top-level group with an encrypted field") with the same persisted push-hash as the encrypted fields instead of the disk-seeded snapshot. A never-published URL now publishes on the next save and rejoins its credentials. Empty values stay local, mirroring the encrypted-field rule. Structural settings keep their disk-seeded clobber protection..checkboxa crisp 1pxbase-contentborder in e-ink mode so a configured-but-disabled provider's enable box stays visible on grayscale panels. Scoped to.checkboxso the.toggleswitch keeps its own treatment (eink-borderedis wrong here — its forcedbase-100background would wipe the checked fill).Tests
serverUrldoes not), now passing.kosync.serverUrlto assert no-push) to instead assert that only structural fields stay out of the diff and that connection metadata is exempt from disk-seed priming.Verification
pnpm test— 7565 passed / 9 skippedpnpm lint(tsgo + Biome) — clean🤖 Generated with Claude Code