LT-21402: Part 3 - Move MasterRefresh to Pub/Sub (Insert/Delete) - #1039
Merged
Conversation
These two senders (InsertEntryDlgListener.DialogInsertItemInVector and RecordClerk.OnDeleteRecord) both update the cache directly (UOW + PropChanged), so when an XHTML document view is active, the Mediator's High-priority stop-when-handled intercept correctly satisfied the refresh with a fast content-only reload; the full master refresh was only needed in the other tools. Pub/Sub has no stop-when-handled, so the intercept is replaced with a two-stage refresh request. - New event RefreshCurrentView. The sender publishes it (window-scoped) with a ReturnObject; a subscriber that can satisfy the request by regenerating its own content sets ReturnValue. If no subscriber claims the request, the sender publishes MasterRefresh instead. - XhtmlDocView subscribes while it exists (Init/Dispose), i.e. exactly while its tool is the active content control - the subscription lifetime does the routing that colleague priority used to do. - XhtmlRecordDocView (the Lexicon Edit preview pane) deliberately does NOT subscribe: in Lexicon Edit these commands do the full refresh today, and that is preserved. Behavior is unchanged: content-only reload when a Dictionary, Reversal Indexes, or Classified Dictionary document view is active; full master refresh everywhere else. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1039 +/- ##
==========================================
- Coverage 33.05% 33.04% -0.01%
==========================================
Files 1202 1202
Lines 278342 278365 +23
Branches 37191 37195 +4
==========================================
Hits 91994 91994
- Misses 158493 158511 +18
- Partials 27855 27860 +5
🚀 New features to boost your workflow:
|
papeh
reviewed
Aug 5, 2026
papeh
approved these changes
Aug 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Converts the last two synchronous MasterRefresh senders —
InsertEntryDlgListener.DialogInsertItemInVector(Insert Entry) andRecordClerk.OnDeleteRecord(Delete Record) — completing the synchronous half of theLT-21402 migration (follows #1033 and #1038).
These two were deliberately excluded from Part 1: both commands update the cache directly
(UOW + PropChanged), so when an XHTML document view is active, the Mediator's
High-priority stop-when-handled intercept correctly satisfied the refresh with a fast
content-only reload; the full master refresh was only needed in the other tools.
Converting them to a plain
Publish(MasterRefresh)would have turned that fast, correctreload into a needless full refresh.
Design: two-stage refresh request
Pub/Sub has no priority or stop-when-handled, so the intercept is replaced with a
two-stage request, using the same
ReturnObjectidiom as theDialogInsertItemInVectorconversions (see
RecordClerk.OnInsertItemInVector):RefreshCurrentView. The sender publishes it (window-scoped) with aReturnObject; a subscriber that can satisfy the request by regenerating its owncontent sets
ReturnValue. If no subscriber claims the request, the sender publishesMasterRefreshinstead.XhtmlDocViewsubscribes while it exists (Init/Dispose) — i.e. exactly while its toolis the active content control — so the subscription lifetime does the routing that
colleague priority used to do.
XhtmlRecordDocView(the Lexicon Edit preview pane) deliberately does notsubscribe: in Lexicon Edit these commands do the full refresh today, and that is
preserved.
Behavior is unchanged: content-only reload when a Dictionary, Reversal Indexes, or
Classified Dictionary document view is active; full master refresh everywhere else.
The
JumpToRecordsend next to the Insert Entry site stays on the Mediator; that messageis a separate conversion.
Remaining MasterRefresh work (future PRs)
Still on the Mediator: the F5/CmdRefresh menu command (which can reuse this two-stage
pattern when converted), four deferred
BroadcastMessagesenders, and onePostMessagesender — each needs per-site timing analysis before conversion.
Testing
manual tests).
FwXWindow.OnMasterRefreshnot invoked, jump-to-new-entry intact) and from LexiconEdit (full refresh, unchanged); reversal document view delete; multi-window scoping
(single dispatch, focus retained).
🤖 Generated with Claude Code
This change is