Skip to content

Carry the set view's prerendered diff into the circuit and close its test gaps - #2657

Merged
pournasserian merged 3 commits into
v2from
2627-diff-island
Oct 20, 2026
Merged

pournasserian merged 3 commits into
v2from
2627-diff-island

Conversation

@pournasserian

@pournasserian pournasserian commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

Closes #2627

What

Follow-ups from the independent review of #2576 (F-DSK, #2422).

  • The set view's diff island carries its prerendered diff into the circuit.
    • The island keeps the diff it prerendered in PersistentComponentState, and the circuit takes it back.
    • The circuit shows the same items at once. It doesn't read the diff again and never shows "Loading the items…" in their place.
    • ItemDiff.Restore and ValueDiff.Restore rebuild the diff model from what was kept, as ChangeOperation.Restore already does for operations.
  • The circuit hub takes messages up to 1 MB. Kept state travels in the circuit's first message, so the 32 KB default would refuse a large set's diff. The hub requires a signed-in person. Kept state reaches the hub about 1.8 times as large as its JSON, because Blazor encodes it twice and encrypts it. So a diff over 480 KB of JSON isn't kept, and the circuit reads it again as before. AdminLimits holds both sizes.
  • A source with a look-alike host shows the host it resolves to next to the link text. For example, https://аpple.com/ with a Cyrillic "а" shows (host xn--pple-43d.com). The address the link opens is unchanged.
  • History labels go through the localizer. An event without its own label reads "Other event (operation)", and the "UTC" suffix is localized.

Why

  • Persisted state, not a second read. On PostgreSQL the second read was truly asynchronous, so the list emptied while it ran: the scroll jumped, folded items opened again, and focus on a summary was lost. Carrying the diff costs the size of the state, which the hub limit covers.

Tests

  • Browser, on PostgreSQL when it is configured (as in CI): a 200-item set arrives in batches to all 200 items. The number of items shown never drops below the prerendered batch when the circuit attaches. Without the fix, the test fails on PostgreSQL.
  • Browser: a set of 100 long pages, whose diff is too large to keep, still attaches its circuit and shows all 100 items. With the earlier limit of 768 KB, this test fails.
  • Host, on SQLite and PostgreSQL:
    • The set view shows its rationale, sources, history and first items.
    • A look-alike source shows its punycode host, and only that one.
    • A rejected revert shows its reason.
    • A set an agent opened over MCP shows the agent and renders with dir="rtl".
  • bUnit:
    • The circuit takes the prerendered diff without reading it again or showing the busy state.
    • AsciiHost names a look-alike host and leaves an ASCII host or an IPv6 address alone.
    • A diff too large to keep is read again by the circuit.
  • Unit: a restored item diff holds what it was restored from.

dotnet build -warnaserror, the unit and bUnit suite, and the set view, review, keyboard and accessibility tests on SQLite and PostgreSQL pass locally. No new package and no new project reference.

Checklist

  • Linked to an issue a maintainer has confirmed
  • Targets v2
  • Tests or docs updated where behaviour changed
  • No tool-generated co-author trailers or footers

@pournasserian pournasserian added this to the M1 Governance core milestone Oct 20, 2026
@pournasserian pournasserian added v2 FluentCMS v2 (v2 branch) type:bug Defect area:desk Review desk (DSK) labels Oct 20, 2026
@pournasserian
pournasserian merged commit 4dfb3cf into v2 Oct 20, 2026
2 checks passed
@pournasserian
pournasserian deleted the 2627-diff-island branch October 20, 2026 02:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:desk Review desk (DSK) type:bug Defect v2 FluentCMS v2 (v2 branch)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Carry the set view's prerendered diff into the circuit and close its test gaps

1 participant