Skip to content

fix: set sha safely#52

Open
okv wants to merge 1 commit into
silvanocerza:mainfrom
okv:main
Open

fix: set sha safely#52
okv wants to merge 1 commit into
silvanocerza:mainfrom
okv:main

Conversation

@okv
Copy link
Copy Markdown

@okv okv commented Mar 28, 2026

Hi @silvanocerza, thank you very much for your work on this amazing Obsidian Plugin!

I find it very useful especially when using on mobile. Unfortunately, sometimes mobile sync was failing for me with this error:

Error syncing. TypeError: Cannot set properties of undefined (setting 'sha')

Eventually, I added guards in three places, installed and tested the plugin using BRAT.

Please take a look at this patch when you have some time.

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