Fix: Detect files modified directly on GitHub #49
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
Fixes #45
When files are edited directly on GitHub (via web UI or other means outside the plugin), the plugin fails to detect these changes during sync. The user sees "Nothing to sync" even though files have been modified remotely.
Root Cause
The plugin uses a manifest file (
github-sync-metadata.json) to track file SHAs. The manifest only updates when syncing through this plugin. When someone edits a file directly on GitHub:Solution
After fetching the remote manifest, we now compare:
getRepoContent())If they differ, we update the manifest entry to reflect the actual state. This allows
determineSyncActions()to detect the change and trigger a download.Changes Made
Testing
✅ Tested and verified working:
Before fix: "Nothing to sync"
After fix: File detected and downloaded
Test Environment
Impact
sync-manager.tsAdditional Notes
This fix handles two scenarios:
The manifest comment documents why this comparison is necessary - without it, future maintainers wouldn't understand the limitation of the manifest-based approach.