Skip to content

Fix potential error when deleting remote files in sync manager#28

Open
kj-9 wants to merge 1 commit into
silvanocerza:mainfrom
kj-9:skip-deleted-file
Open

Fix potential error when deleting remote files in sync manager#28
kj-9 wants to merge 1 commit into
silvanocerza:mainfrom
kj-9:skip-deleted-file

Conversation

@kj-9
Copy link
Copy Markdown

@kj-9 kj-9 commented Jul 9, 2025

Summary

Fix sync error when deleting files on Android and syncing with macOS

Issue

Closes #21

When deleting files on Android and then syncing with github repo pushed from macOS, a sync error occurs as described in the linked issue.

Notes

There may be potential to remove the .sha = null setting entirely, but the side effects are unclear for me.

@dedestem
Copy link
Copy Markdown

dedestem commented Jul 18, 2025

This isn't only with MacOS.

Because i also get this when syncing between linux & android.

However i hope that this gets accepted.

Thank you for thanking your time to fix it (:

@dbarnett
Copy link
Copy Markdown

+1 hoping this gets merged!

Note there's a parallel error about "path" vs "sha" that I believe comes from calling downloadFile on undefined, but we could treat that separately and file a new issue for it if needed. It's not quite as common as the "undefined (setting sha)" one.

@seeReadCode
Copy link
Copy Markdown

@silvanocerza anything I can do to help get this PR merged? thanks

@dbarnett
Copy link
Copy Markdown

FWIW I've moved to the FIT plugin instead, which is very similar but I found slightly less buggy. It does still have a few bugs like this, but I'm a co-maintainer on FIT now and have some changes nearly finished to finally fix it properly there.

@mofeezansari99-maker
Copy link
Copy Markdown

IM NOT THAT TECH SAVY BUT HOW TO SOLVE THIS ISSUE???

@kj-9
Copy link
Copy Markdown
Author

kj-9 commented Dec 26, 2025

I recommend using FIT instead.
It is more stable and feels comfortable for daily use.

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.

Error: undefined setting 'sha'

5 participants