Skip to content

fix: compare in UTC and detect moved and reordered pages - #7

Merged
andresvillenas merged 1 commit into
mainfrom
fix/inventory-accuracy
Oct 1, 2026
Merged

andresvillenas merged 1 commit into
mainfrom
fix/inventory-accuracy

Conversation

@andresvillenas

Copy link
Copy Markdown
Collaborator

Fixes the accuracy gaps found in the foundation design review: time zones, moved and reordered pages, and clearer guidance for editors.

Changes

  • Time zones (bug).
    • Before: Xperience stores dates in the server's local time, and the inventory endpoint sent them without a time zone, so a source and target in different time zones compared the wrong moments.
    • Now: both inventories convert to UTC, the endpoint sends dates with a Z suffix, and the schema version is 2. A date without a time zone (from a target on schema version 1) is read as this server's local time, the same as before, so mixed versions behave as they did.
  • Moved and reordered pages. Moving or reordering a page changes neither its version nor its publish date, so the date comparison couldn't see it.
    • Moved: a different tree path on the target → Out of date on target.
    • Reordered: for each level, the pages present on both sides are compared by relative order; if it differs, those pages become Out of date. The whole level is marked because Kentico requires all pages on the level to be synced to transfer an order change. Comparing relative order means a page that exists on only one side doesn't cause false positives.
    • The inventory now carries each page's order.
  • Reasons and tooltips. Each status item carries a Reason (newer here, publish state, moved, reordered). The status tooltip explains it and what to sync. For items only on the target, the tooltip explains that Content Sync can't delete, so they have to be deleted on the target.
  • Dates in the editor's time zone. The Last published column uses the same local date-time cell as Kentico's own listings. Its C# helper is internal, so the cell is built with the same component name, which is noted in the spec as a convention covered by the two-version check.
  • Example host. Content Sync packages are excluded from DancingGoat's content items; their JSON files were included twice and broke the build after a real sync.
  • Docs.
    • Foundation spec: time zones, the move and reorder rules, deletions, and why content fingerprints and triggering a sync are deferred.
    • Admin page spec: tooltips, dates, and the date filter's server-time days.
    • Usage Guide: moved, reordered and deleted items, time zones, and what the page can't see (edits on the target, scheduled publishing).

Testing

  • 181 unit tests pass (new: UTC conversion, schema 1 and 2 dates over the wire, move and reorder rules including the shifted-order case, reasons, tooltips).
  • Verified live on 31.7.2:
    • the endpoint sends schema 2 with UTC dates and page order;
    • the Last published column renders like the Content hub's date column;
    • reordering two pages in the source's page tree left both publish dates unchanged and marked the Articles level Out of date with the reorder tooltip;
    • a source-only page on that level stayed Missing;
    • moving the page back restored In sync.
  • Not verified live: moving a page to another parent. Dancing Goat's page type restrictions only allow article pages under Articles; the rule is covered by unit tests.

Fix the foundation's accuracy gaps found in the design review.

- Publish dates were compared in each server's local time: Xperience
  stores server-local time and the endpoint sent it without a time
  zone, so instances in different time zones compared the wrong
  moments. Both inventories now convert to UTC, the endpoint sends
  dates with a Z suffix, and the schema version is 2. A date without a
  time zone, as an older target sends, is read as before.
- Moving or reordering a page changes neither its version nor its
  publish date. A different tree path on the target is now out of
  date (moved), and a level whose shared pages are in a different
  relative order marks those pages out of date (reordered), since
  Content Sync needs the whole level synced. The inventory carries each
  page's order for this.
- Each status item carries a reason for being out of date, and the
  status tooltip explains it, including that Content Sync can't delete
  items only on the target.
- The Last published column uses the same local date-time cell as
  Kentico's own listings, so it shows each editor's time zone.
- Exclude Content Sync packages from the example's content items; their
  JSON files were included twice and broke the build after a sync.
- Update the foundation and admin page specs and the Usage Guide,
  including what the page can't see and why content fingerprints and
  triggering a sync are deferred.
@andresvillenas
andresvillenas merged commit c090792 into main Oct 1, 2026
3 checks passed
@andresvillenas
andresvillenas deleted the fix/inventory-accuracy branch October 1, 2026 17:51
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