Artifact 5c7c6f92012645c1981b4f79d49c70b778d2a391145ed45104c0db9d34950870:
- File
internal/sync/stubs.go
— part of check-in
[d3fb5397c8]
at
2026-10-13 15:15:43
on branch main
— fix(sync): answer a client clone_seqno with bad command; make Clone's phantom pull opt-in (#427)
* fix(sync): answer a client clone_seqno with bad command; make Clone's phantom pull opt-in
Two deliberate #255 deviations from sync-protocol-01 move to conformance.
SP-5.2-6: the server now answers a client-sent clone_seqno with "error bad command" and processes the cards after it, as Section 5.2 requires for a reply-only card and as fossil's page_xfer does.
SP-8.2-5: Clone now sends nothing after clone_seqno 0 and its cleanup round, so by default it leaves the phantoms a clone produces in place, as fossil(1)'s clone does. The follow-up pull that fetched them is now opt-in through CloneOpts.PullPhantoms, whose doc comment says enabling it departs from Section 8.2.
Both cases leave the sync deviations map. Tracked in #424.
* fix(sync): quote a client clone_seqno as received in bad command; keep DST coverage of the opt-in pull
Tracked in #424. (user: [email protected], size: 1117) [annotate] [blame] [check-ins using]
package sync import "github.com/danmestas/go-libfossil/simio" // CloneOpts configures a clone operation. type CloneOpts struct { User string // Credentials for clone auth (also default admin user) Password string Version int // Protocol version (default 3) Env *simio.Env // nil defaults to RealEnv Observer Observer // nil defaults to no-op Buggify BuggifyChecker // fault injection for DST (nil = no faults) // PullPhantoms, when set, makes Clone fetch the artifacts the clone // rounds left missing with a follow-up pull session, and fail with a // *PhantomStallError if any are still missing after it. That pull // departs from Section 8.2 of the sync draft, which sends no clone, // pull or push card after clone_seqno 0, so it is off by default. PullPhantoms bool } // CloneResult reports what happened during a clone. type CloneResult struct { Rounds int BlobsRecvd int ArtifactsLinked int // Manifests crosslinked into event table ProjectCode string ServerCode string Messages []string // Informational messages from server }