Skip to content

fix(sync): accept an empty remote manifest without a format version - #1025

Merged
ctawiah merged 1 commit into
mainfrom
ctawiah/sync-empty-manifest-format
Nov 10, 2026
Merged

ctawiah merged 1 commit into
mainfrom
ctawiah/sync-empty-manifest-format

Conversation

@ctawiah

@ctawiah ctawiah commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Context

Every sync starts with a read of the remote manifest of each project in scope. LaunchDarkly answers a project and a repository source that no sync wrote yet with {"items":[],"source":"..."}. The body has no formatVersion, so it decodes as version 0. The client required version 1, so the first sync of any project failed before the plan with sync manifest for project "x": unsupported formatVersion 0.

What changes

  • SyncManifest.Unwritten reports a manifest with no entries and no format version.
  • GetSyncManifest, PatchSyncManifest, and the manifest store accept an unwritten manifest as an empty manifest of the supported format.
  • A manifest with entries still needs the supported format version.

Design notes

  • The first push writes a manifest with formatVersion: 1, which the client already sends in its patch body, so the unwritten state lasts until the first write.

Review focus

  • Is "no entries and no format version" the right definition of an unwritten manifest?

Verification

  • go test ./...
  • golangci-lint run ./...
  • TestClientAcceptsAnUnwrittenSyncManifest and TestStoreLoadsAnUnwrittenManifestAsEmpty cover the empty body and the body with entries but no version.
  • A read of the staging manifest endpoint for a project without a manifest returns the body above.

Follow-up

The patch body still carried formatVersion, which the API rejects. A second pull request removes the field from the client.

🤖 Generated with Claude Code

LaunchDarkly answers a project and a source that no sync wrote yet with an empty manifest that has no formatVersion. The client required version 1, so every first sync of a project failed before the plan with "unsupported formatVersion 0". The client and the store now treat an empty manifest without a format version as an empty manifest of the supported format. A manifest with entries still needs the supported format.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@ctawiah
ctawiah requested a review from a team as a code owner November 10, 2026 17:56
@ctawiah
ctawiah requested review from davidbrackbill and nkester-ld and removed request for a team November 10, 2026 17:56
@ctawiah
ctawiah merged commit 44c0b72 into main Nov 10, 2026
12 checks passed
@ctawiah
ctawiah deleted the ctawiah/sync-empty-manifest-format branch November 10, 2026 18:00
@ctawiah ctawiah changed the title fix(sync): accept an empty remote manifest without a format version fix(sync): drop formatVersion from the sync manifest API Nov 10, 2026
@ctawiah ctawiah changed the title fix(sync): drop formatVersion from the sync manifest API fix(sync): accept an empty remote manifest without a format version Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants