dsh-prompt-pocket 1.0.6 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +6 -1
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -408,7 +408,12 @@ async function runSync(cfg) {
408
408
  const local = await readStore();
409
409
  const remote = await readRemoteEntries(cfg);
410
410
  const merged = remote ? mergeStores(local, remote) : { entries: local.entries, tombstones: local.tombstones, added: 0, updated: 0, skipped: 0, deleted: 0 };
411
- await writeStore({ version: 1, entries: merged.entries, tombstones: merged.tombstones });
411
+ // A sync can take seconds (fetch, worktree, push). Anything saved or deleted
412
+ // while it runs is newer than the snapshot read above, so merge that in before
413
+ // writing: otherwise the tail of the sync resurrects what was just deleted.
414
+ const fresh = await readStore();
415
+ const settled = mergeStores(merged, fresh);
416
+ await writeStore({ version: 1, entries: settled.entries, tombstones: settled.tombstones });
412
417
  await git(['add', '-A']);
413
418
  const status = await git(['status', '--porcelain']);
414
419
  if (status.ok && status.stdout.trim()) await git(['commit', '-m', `pocket sync ${new Date().toISOString()}`]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-prompt-pocket",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "A prompt pocket that floats in the corner: save the draft or the selected text with Ctrl+Shift+S, click a saved prompt to drop it back at the caret.",