fix: honest first-sync preview count; drop Advanced testing UI#92
Merged
Conversation
|
🎉 PR Validation ✅ PASSED Commit: Checks:
Ready to merge! ✨ |
Fix 1: previewSync reported pendingCount() (the failed-push retry queue), which is 0 on a fresh memory pick - so the popup said "0 local change(s) to send" then first-synced everything. It now reports the honest outgoing count = local md files whose content-rev differs from the chosen memory's push-rev cache (every file on a fresh memory), plus locally-deleted cached paths. Computed offline (no controller, no network) via a shared CouchSync.countOutgoing that reuses contentRevOf - the exact rev pushFile caches - so the preview can never drift from what pushAll sends. Fix 2: remove the Advanced toggle + Site host dev-override field from the settings page. siteFqdn stays in the model and host resolution, so a value written directly in data.json still overrides the host on restart (the dev/testing lever); only the on-page editor is gone.
…ses countOutgoing
vreshch
force-pushed
the
fix/first-sync-preview-and-drop-advanced
branch
from
July 8, 2026 23:36
578aad6 to
4876590
Compare
vreshch
marked this pull request as ready for review
July 8, 2026 23:36
vreshch
added a commit
that referenced
this pull request
Jul 17, 2026
…96) Reverts #89 (couch-only). Git = default channel for every memory; a memory the resolution advertises on couch routes to the couch controller (server decides per memory, future /api/me capabilities gate the paid couch tier). - src/git/* + sync-controller restored; couch impl stays at master (resilient syncNow, missing-leaf abort, pendingCount) - previewSync routes per channel: git = both-way controller preview, couch = honest outgoing count (#92 semantics kept); SyncPreview.incoming optional - fake router advertises git_endpoint; lifecycle 10 rewritten for dual-channel
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.
Two dogfooding UX fixes to the couch-only plugin, one PR.
Fix 1 - honest first-sync preview count (the real bug)
Repro: Sign in, pick a FRESH memory (cloud empty) while the local vault already has notes. The sync-preview popup shows
↑ 0 local change(s) to send, then the first sync pushes everything. The count was a lie.Root cause:
previewSync()returnedcouchChannel.pendingCount(), which is the failed-push retry queue - always 0 on a fresh pick because no controller is active yet.Fix:
previewSync()now returns the honest outgoing count = local markdown files whose current content-rev is absent-from / differs-from the chosen memory's persisted push-rev cache, plus cached paths deleted locally. On a fresh memory (empty cache) that is every md file.CouchSync.countOutgoing(vault, state)computes it with no controller and no network (loads the persisted couch-state for the chosen memory, lists vault md files, hashes each once).contentRevOf(body)- the exact revpushFilecaches (pushFilenow derives its skip rev from the same helper) - so the preview count cannot drift from whatpushAllactually sends.firstSync(not-signed-in / no-memory) branch is kept; the modal wording stays "N local change(s) to send" and is now truthful.0 to send(then pushes N)N to send0011(the delete)Fix 2 - drop the Advanced testing UI (keep the capability)
Removed the "Advanced" toggle + the "Site host" dev-override field from the shipped settings page (plus the now-dead
showAdvancedmodel field,renderHostState,notifyRestartDebounced,pendingSiteFqdn, andhostState).siteFqdnis kept in the settings model and in host resolution (resolveSiteFqdn/activeSiteFqdn), so a value written directly indata.jsonstill overrides the host on restart - this is the dev/testing lever and it keeps working. Only the on-page editor is gone. (README/CLAUDE.md never documented the field, so no doc change was needed;check:docs/check:hostsstay green.)Tests
CouchSync.countOutgoing- fresh memory counts every file, 0 after a full sync, counts only changed files, counts a local delete.bootPlugin+ fake-couch): fresh memory with 3 local files -> preview reports 3 (not 0) before the first push, 0 after a full sync;firstSync=truewhen no memory is chosen.Verify
npm run verifyfully green: type-check + lint (0 errors) + format + 116 tests + build + check:hosts/docs/bundle. No version bump.