Skip to content

fix: align push diff with experimentalPushAll union semantics#57

Merged
robrechtme merged 1 commit into
mainfrom
fix/experimental-push-all-union-diff
May 12, 2026
Merged

fix: align push diff with experimentalPushAll union semantics#57
robrechtme merged 1 commit into
mainfrom
fix/experimental-push-all-union-diff

Conversation

@robrechtme
Copy link
Copy Markdown
Owner

Summary

  • Recompute the deleted set leaf-by-leaf under experimentalPushAll + delete-absent so the diff matches what the multi-locale upload will actually do. detailedDiff collapses entirely-missing branches into a single undefined at the branch level, which lost the resolution needed to apply union semantics correctly.
  • Skip deleted entries whose path is present in any other local locale — Loco's format=multi evaluates delete-absent against the union of locales, so union-protected entries won't actually be deleted.
  • Tighten the allNoOp guard in push to only fail when the diff contains actionable add/update entries. Loco returns "Nothing updated" for successful delete-absent-only pushes too, which previously caused spurious push: no-op failures.
  • Improve the no-op error message to point at loco-cli pull as a reconciliation step.
  • Split the early-exit branches in push so the "delete-absent disabled" message no longer fires when the diff is empty.

Test plan

  • pnpm test — 92 passing, including new coverage for branch-collapsed diffs, union-protected leaves, sibling-leaf retention, and deletion-only push success
  • pnpm lint, pnpm format:check, pnpm build
  • End-to-end against a live Loco project (en + nl locales):
    • Push 1 (add key only to en): asset created, source-fallback in nl
    • Push 2 (the bug-trigger second push): now Everything up to date! instead of push: no-op
    • Push 3 (real deletion): asset removed on Loco, exit 0 instead of misleading quota error

Fixes #56

- Recompute the deleted set leaf-by-leaf under `experimentalPushAll` +
  `delete-absent` so it matches what the multi-locale upload will actually
  do. `detailedDiff` collapses entirely-missing branches into a single
  undefined at the branch level, which lost the resolution needed to
  apply union semantics correctly
- Skip deleted entries whose path is present in any other local locale —
  Loco's `format=multi` evaluates `delete-absent` against the union of
  locales, so union-protected entries won't actually be deleted
- Tighten the `allNoOp` guard in `push` to only fail when the diff
  contains actionable add/update entries. Loco returns "Nothing updated"
  for successful delete-absent-only pushes too, which previously caused
  spurious `push: no-op` failures
- Improve the no-op error message to point at `loco-cli pull` as a
  reconciliation step
- Split the early-exit branches so the `delete-absent disabled` message
  no longer fires when the diff is empty

Fixes #56
@vercel
Copy link
Copy Markdown

vercel Bot commented May 12, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
loco-cli Ready Ready Preview, Comment May 12, 2026 9:21am

@robrechtme robrechtme merged commit 9bf9dc6 into main May 12, 2026
3 checks passed
@robrechtme robrechtme deleted the fix/experimental-push-all-union-diff branch May 12, 2026 09:24
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.

experimentalPushAll: push fails on union-protected remote-only diff with misleading quota error

1 participant