Skip to content

Fix unnecessary gist rewrites during sync upload#1465

Open
cedar323 wants to merge 1 commit into
shanalikhan:masterfrom
cedar323:issuehunt-508-changed-gist-upload
Open

Fix unnecessary gist rewrites during sync upload#1465
cedar323 wants to merge 1 commit into
shanalikhan:masterfrom
cedar323:issuehunt-508-changed-gist-upload

Conversation

@cedar323

Copy link
Copy Markdown

Summary

  • upload only changed gist files instead of resending the full gist payload
  • explicitly delete remote-only gist files while preserving keybindings* variants
  • show deleted gist files in the upload summary and cover the diff/payload logic with tests

Why

Issue #508 reports that every sync upload rewrites all gist files, which produces unnecessary updates. This change computes a minimal gist patch from the remote gist state and local setting files, then sends only changed entries plus explicit deletions.

Compared with #1461, this also verifies the actual PATCH payload shape and preserves remote keybindings variants from accidental deletion.

Validation

  • npx tsc src/service/gistUpdate.ts test/service/gistUpdate.test.ts --module commonjs --target es2018 --lib es2018 --types node,mocha,chai --esModuleInterop --skipLibCheck --outDir .tmp-gistupdate-test
  • node .\\node_modules\\mocha\\bin\\mocha .\\.tmp-gistupdate-test\\test\\service\\gistUpdate.test.js

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