Skip to content

Keep items that have a clean marker in the import order - #1182

Merged
KevinJump merged 1 commit into
v17/mainfrom
v17/fix/clean-marker-import
Nov 1, 2026
Merged

KevinJump merged 1 commit into
v17/mainfrom
v17/fix/clean-marker-import

Conversation

@KevinJump

Copy link
Copy Markdown
Member

Summary

A clean marker has the same key as the item it cleans and no Level, so SyncHandlerLevelBase sorts it ahead of the item. SyncHandlerContainerBase.GetMergedItemsAsync then took the first entry for each key, so the marker replaced the item in the report and import lists.

Clean markers now stay out of that DistinctBy and go at the end of the list, after the renames. Delete markers are handled as before.

This affects handlers built on SyncHandlerContainerBase. uSync.Complete's Publisher hits it when a pack keeps its clean markers, which it does when the report has something to delete. A delete can then run while the changed and new items in the same pack aren't imported. It's needed for Jumoo/uSync.Complete#194.

Related: Jumoo/uSync.Complete.Issues#279

Testing

  • CleanMarkerOrderTests: 3 new tests that fail without the change. Full uSync.Tests suite passes (197).
  • Real pushes between two sites, using this core build (stamped 17.5.0) with uSync.Complete#194:
    • Ticked, orphan on target, a changed type and a new type: orphan deleted, both types arrived.
    • Ticked, nothing to delete: change arrived.
    • Unticked, orphan on target: change arrived, nothing deleted.

Only document types were pushed for real. Data, media and member types share the code but weren't tested that way. v18 still needs a forward port.

🤖 Generated with Claude Code

A clean marker has the same key as the item it cleans and no level, so
it sorts ahead of the item. Container handlers then took the first entry
for each key, which dropped the item from the report and import lists.

Clean markers now stay out of that distinct and go at the end of the
list, after the renames. Publisher only sees this when a pack keeps its
markers, which is when the report has something to delete.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the release/17.5.2 uSync 17.5.2 release label Nov 1, 2026
@KevinJump
KevinJump merged commit 0d30722 into v17/main Nov 1, 2026
8 checks passed
@KevinJump KevinJump mentioned this pull request Nov 1, 2026
2 tasks done
@KevinJump
KevinJump deleted the v17/fix/clean-marker-import branch November 1, 2026 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release/17.5.2 uSync 17.5.2 release

Development

Successfully merging this pull request may close these issues.

1 participant