Skip to content

fix(mobile): reconcile GitHub API vault files when commit SHA unchanged#201

Merged
dep merged 1 commit intomainfrom
cursor/recent-commits-critical-bugs-7096
Apr 2, 2026
Merged

fix(mobile): reconcile GitHub API vault files when commit SHA unchanged#201
dep merged 1 commit intomainfrom
cursor/recent-commits-critical-bugs-7096

Conversation

@cursor
Copy link
Copy Markdown

@cursor cursor bot commented Apr 2, 2026

Summary

Removes an incorrect early return in refreshViaGitHubApi that skipped file reconciliation whenever the remote branch tip matched the stored commitSha.

Problem

commitSha equality does not imply the working copy matches the remote tree. After a crash, partial download, manual deletion, or stale metadata.files, the user could stay on the correct commit while missing files. Refresh then did nothing, leaving notes invisible or corrupt relative to GitHub.

Change

  • Always run the existing blob reconciliation loop in refreshViaGitHubApi.
  • Add a unit test: remote tip unchanged, tree lists a new blob, file missing locally → blob is downloaded and metadata updated.

Validation

npx jest mobile/__tests__/services/gitService.test.ts

Open in Web View Automation 

…anged

refreshViaGitHubApi returned early when remote commit SHA matched stored
metadata, skipping blob reconciliation. That breaks recovery when local
files are missing or metadata.files is stale while still at the same tip.

Remove the early return and add a regression test for missing blobs at
unchanged commit.

Co-authored-by: Danny Peck <dannypeck@gmail.com>
@dep dep marked this pull request as ready for review April 2, 2026 12:53
@dep dep merged commit c74ed0b into main Apr 2, 2026
4 checks passed
@dep dep deleted the cursor/recent-commits-critical-bugs-7096 branch April 2, 2026 12:53
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.

2 participants