Skip to content

Commit 7a261e3

Browse files
committed
v0.1.16: Skip checksum validation for blob categories in merge
Fixes checksum mismatch errors during conflict resolution that caused sync to fail. Blob categories (config, state, etc) legitimately differ between machines and CDN caching causes false positives.
1 parent 2b16414 commit 7a261e3

4 files changed

Lines changed: 16 additions & 5 deletions

File tree

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "oc-sync",
3-
"version": "0.1.15",
3+
"version": "0.1.16",
44
"description": "Sync OpenCode data across machines using a private GitHub repository with vector clock conflict resolution",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",

src/sync/engine/remote-fetch.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,16 @@ export async function fetchRemoteItemsNotLocal(
9797
if (filesToFetch.length === 0) return [];
9898

9999
syncLog(`[PUSH] Fetching ${String(filesToFetch.length)} remote items to write locally`);
100-
const contents = await backend.getFiles(filesToFetch.map((f) => f.filename));
100+
101+
const filenames = filesToFetch.map((f) => f.filename);
102+
const contents = await backend.getFiles(filenames);
103+
104+
// Count how many files we actually got (some may be missing from repo)
105+
const gotCount = Object.values(contents).filter((c) => c !== null).length;
106+
if (gotCount < filenames.length) {
107+
syncLog(`[PUSH] Note: ${String(filenames.length - gotCount)} remote items not found in repo`);
108+
}
109+
101110
const categoryItems = processDownloadedContent(filesToFetch, contents);
102111

103112
// Convert to CategoryData[]

src/sync/operations/merge-operation.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,9 @@ async function downloadAndDecryptCategory(
177177
backend: StorageBackend
178178
): Promise<string> {
179179
const chunks = await downloadChunks(storageFiles, info.files, backend);
180-
const data = unpackCategory(chunks, info.checksum);
180+
// Skip checksum validation - blob categories legitimately differ between machines
181+
// (dev/prod builds, different projects/state) and CDN caching causes false positives
182+
const data = unpackCategory(chunks);
181183
return maybeDecrypt(category, data, passphrase);
182184
}
183185

0 commit comments

Comments
 (0)