Skip to content

Fix sync failures on stale blob SHAs and ignore volatile sync log metadata#58

Open
tiagoarroz wants to merge 2 commits into
silvanocerza:mainfrom
tiagoarroz:fix/stale-blob-recovery
Open

Fix sync failures on stale blob SHAs and ignore volatile sync log metadata#58
tiagoarroz wants to merge 2 commits into
silvanocerza:mainfrom
tiagoarroz:fix/stale-blob-recovery

Conversation

@tiagoarroz
Copy link
Copy Markdown

@tiagoarroz tiagoarroz commented May 6, 2026

Problem

Sync could fail with 404 Not Found on GET /git/blobs/{sha} when remote metadata referenced stale blob SHAs.
This caused sync to abort repeatedly.

What changed

  • Added stale-SHA recovery for remote blob reads.
  • Added reconciliation of remote metadata SHAs against the current remote tree before conflict checks.
  • Excluded .obsidian/github-sync.log from normal metadata/conflict flow as a volatile internal artifact.
  • Hardened conflict detection to skip internal sync files and avoid hard-fail on stale blob references.

Expected result

  • Sync no longer fails hard when a metadata SHA is outdated.
  • Plugin recovers using the current tree SHA when possible.
  • Volatile log metadata no longer contributes to recurring sync inconsistencies.

agungwas added a commit to agungwas/github-gitless-sync that referenced this pull request May 14, 2026
- fix(sync): process ZIP entries sequentially to prevent memory exhaustion
  on large vaults during initial sync from remote (refs silvanocerza#24)

- fix(sync): add null guard before setting sha on delete_remote tree item
  to prevent TypeError on mobile when file entry is missing (refs silvanocerza#52, silvanocerza#28)

- fix(sync): use SHA as primary truth in determineSyncActions instead of
  timestamps, preventing files modified by plugins or external tools from
  being silently skipped on sync

- fix(sync): correct inverted syncConfigDir condition in ZIP extraction
  that caused .obsidian folder to be skipped when config sync was enabled

- fix(sync): auto-reconcile config dir files into metadata on loadMetadata
  when syncConfigDir is true, so users no longer need to toggle the setting
  after enabling it

- fix(sync): recover from stale blob SHAs by falling back to current tree
  SHA on 404 responses, preventing sync failures after force-pushes (refs silvanocerza#58)

- fix(sync): exclude volatile sync artifacts (github-sync.log) from
  metadata and conflict detection to prevent recurring false conflicts

- fix(sync): reconcile remote metadata SHAs with live tree on each sync
  to remove stale references before conflict detection runs

- fix(sync): add null guards on metadataStore.data.files before setting
  sha to prevent TypeError on new files not yet in local metadata
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.

1 participant