Skip to content

Port #997 and #998 (dictionary + sealed/Lock perf work) from v17 - #1019

Merged
KevinJump merged 3 commits into
v18/mainfrom
v18/port-997-998
Aug 5, 2026
Merged

Port #997 and #998 (dictionary + sealed/Lock perf work) from v17#1019
KevinJump merged 3 commits into
v18/mainfrom
v18/port-997-998

Conversation

@KevinJump

Copy link
Copy Markdown
Owner

Brings #997 (avoid unneeded dictionary operations) and #998 (use System.Threading.Lock, seal internal/private classes) onto v18/main.

Cherry-picked rather than merged: v17/main and v18/main diverged back at v17.3.2 and there are ~20 unrelated v17 commits between them, so a merge would drag in far more than these two. Both commits are recorded with -x, so they trace back to the v17 originals.

#997 applied clean. #998 had two conflicts:

SyncHandlerRoot.SyncChangeInfo — v17 has it private, and #998 sealed it. v18 promoted it to protected (with docs) because ElementHandler overrides IsItemCurrentAsync and constructs one. Resolved as protected sealed: keeps v18's accessibility and #998's devirtualization intent. It's only ever instantiated, never derived from, so nothing in the codebase is affected — but it is a (minor) extender API change, so it's noted in the changelog.

uSync.Core/Json/OrderedPropertiesJsonResolver.cs — deleted in v18 by #1014 when the JSON helpers moved to Jumoo.Json, and modified by #998. Resolved by keeping it deleted; the v18 build uses the Jumoo.Json version. The only surviving mention is a comment in JsonSerializerOptionsTests.

Verification

Checked every class #998 sealed against the ported tree — 20 of 21 present, the one absent being OrderedPropertiesJsonResolver as above. All the #997 hunks applied identically to v17, including MergeIgnoreDuplicates's ContainsKey+AddTryAdd (a different code path from the folder-merge work in #1017, so no overlap).

Solution builds clean; 210 tests pass.

Note

Not part of the port, but flagged while porting: PublishableContentHandlerBase.ClaimItemForExport (added in #1018) uses lock (state) on the notification-state dictionary. That's locking on a shared object rather than a dedicated Lock, which is exactly the pattern #998 moved away from in TemplateWatcher. It can't use System.Threading.Lock as-is — the object being locked is Umbraco's dictionary, not ours — but it's worth a look if the sealing/locking cleanup continues.

🤖 Generated with Claude Code

Henr1k80 and others added 3 commits August 5, 2026 11:12
Records the SyncChangeInfo sealing, which is a (minor) extender API change:
it stays protected so handlers can still construct one from an
IsItemCurrentAsync override, but can no longer be derived from.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.

2 participants