Repository navigation
Conversation
Browse views no longer write a clerk's sorted list to the project's Temp folder when they close, new clerks no longer look for such a file, and the cache is no longer purged when saved settings are discarded, after Send/Receive, when the set of interesting texts changes, or on every PropertyChanged broadcast the reversal clerk receives. This is groundwork for moving PropertyChanged off the xCore Mediator: the reversal clerk's purge was the one handler side effect that did not depend on the property name. The restore has returned false unconditionally since the Db4o removal in 2015 (ddf9648) cut the lines that installed the restored list together with the Db4o version-stamp check it meant to remove. Every FieldWorks 9 release has therefore written and parsed these files without using the result, and the purges guarded against a stale restore that could not happen. Reviving the cache was considered and rejected: no release since 9.0 has had it, its guards never checked that the saved order was still current, and even when it worked its only benefit was skipping the first sort of a large list at startup. Cache files already in users' Temp folders are left in place; deleting the project or restoring a backup removes them. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
NUnit Tests 1 files ±0 1 suites ±0 10m 34s ⏱️ - 3m 6s Results for commit b49d9b9. ± Comparison against base commit bd0608d. This pull request removes 2 tests. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1180 +/- ##
==========================================
- Coverage 39.51% 39.50% -0.01%
==========================================
Files 1537 1537
Lines 354706 354424 -282
Branches 41096 41062 -34
==========================================
- Hits 140160 140015 -145
+ Misses 185154 185033 -121
+ Partials 29392 29376 -16
🚀 New features to boost your workflow:
|
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.
Start here: the removed
RestoreFrominSrc/xWorks/RecordList.cs(git show main:Src/xWorks/RecordList.cs). It read the cache file, deleted it and returnedfalse; the rest of the branch is the write and purge machinery around that dead read.Removes the on-disk sort-sequence cache (a file cache, not the LcmCache): the
<clerkId>_SortSeq.fwssfiles every browse view (RecordBrowseView) wrote to the language project'sTempfolder on close, the read attempt when a clerk was created, the serializer in Filters, and the four purges of that folder (discarded settings, Send/Receive, interesting-texts changes, every PropertyChanged broadcast reaching the reversal clerk).Does behaviour change? No list has come back from this cache in any FieldWorks 9 release: the 2015 Db4o removal (ddf9648) deleted the lines that installed the restored list along with the version-stamp check it meant to remove, so the restore has returned
falseever since. The only observable change is that nothing is written, parsed or deleted under<language project>\Temp. Worth your time: did any removed code have a side effect beyond the file system? Two candidates were checked (Evidence).Where to look:
RecordView.InitBase: the restored-list branch is gone; the load-if-needed line keeps its other two conditions.EntriesOrChildClassesRecordList: the removed override also setm_prevFlid;RecordBrowseView.Initoverwrites it with the same value before anything can read it (Evidence).FwXWindow.DiscardPropertiesdeleted the wholeTempfolder, which Send/Receive also uses for a schema copy; its post-Send/Receive call ran after that copy's scope closed.InterestingTextList: the LT-13217 hack deleted related clerks' cache files; with no restore, those clerks reload regardless.IManyOnePathSortItem.PersistDataand the static serializer; no caller in the repo.Deliberately not here: existing
.fwssfiles in users'Tempfolders (deleting the language project or restoring a backup removes them); liblcm'sksSortSequenceTempDirand*.fwsssweep inProjectRestoreService;FwDeleteProjectDlg, which still deletes theTempfolder Send/Receive uses.Off main, independent of #1179; it removes the one name-independent
OnPropertyChangedside effect the PropertyChanged move to Pub/Sub would otherwise have to preserve. Build with both hygiene gates: clean. xWorksTests 1777 passed, 2 skipped, as on main; FiltersTests 24 passed (the two serializer tests went with the serializer). Not run: LexEdDllTests, xCoreTests, manual checks. By hand:<language project>\Temp._SortSeq.fwssfile appeared.Next: approve.
Reading this a year from now -- start here
No working documents were on this branch; the investigation ran in a side session and its notes live outside the repo. This body is the only written record of why the cache was dead and why it was removed rather than revived.
Surprising findings
-appswitch. The survivingreturn false;kept the four-tab indentation of the deletedif (items == null)body, the method closed on the three-tab brace left from a 2012 block, the doc comment still promised to returntrueon success, and the parsed items were read into a local that nothing used. No commit since touched the method.FLExBridgeListener.CopyDictionaryConfigFileToTempputs the dictionary-configuration schema in the sameTempfolder for FLEx Bridge validation.Decisions, and why
XWindow.DiscardPropertieshook. Its only override was the purge; a no-op virtual with no override is the same dead weight.WriteItems,ReadItems,LazyManyOnePathSortItemandPersistDatahad no production caller left, and the tests exercised only them.FwDeleteProjectDlgunchanged. The constant is liblcm's; the backup-restore sweep is harmless; the Delete Project dialog's handling ofTempis still right because Send/Receive creates the folder.Paths not taken
.fwssfiles at startup. Rejected as above.Evidence
string versionStamp, theout versionStampargument,Cache.VersionStampfrom the writer, and then fromRestoreFromtheif (items == null)line, theversionStampblock,m_sortedObjects = items,m_requestedLoadWhileSuppressed = false, theCurrentIndexrestore,SendPropChangedOnListChangeandreturn true, leaving onereturn false.m_prevFlidside effect: the restore attempt ran insideRecordView.InitBase, beforeRecordBrowseView.Inittriggers the bulk-edit bar's class change, and that change goes throughReloadList(int, int, bool), which setsm_prevFlid = m_fliditself before changingm_flid. Before that pointGetNewCurrentIndexcan only reach them_prevFlidcomparison when the obsolete current object's class differs from the list class, which cannot happen for a list that has not changed class.OnFLExBridgewraps the FLEx Bridge launch inusing (CopyDictionaryConfigFileToTemp(projectFolder))and callsRefreshCacheWindowAndAllafter that block.XWindow.DiscardPropertiesoverrides:FwXWindowis the only subclass ofXWindowunderSrc..cs,.xml,.csproj,.resx,.axaml,.ps1,.cppand.hunderSrcfor the removed identifiers,fwssand_SortSeqfinds only the twoksSortSequenceTempDiruses inFwDeleteProjectDlg, which stay.test.ps1 -CommentHygiene -TokenHygiene -SkipNative -StartedBy agent -TestProject xWorksTests: 1779 total, 1777 passed, 2 skipped;-NoBuild -TestProject FiltersTests: 24 passed.Preflight review details
Code Review Summary
Branch: claude/recursing-williams-5c8755
Base: main
Date: 2026-10-09
Review model: Claude Fable 5.1 (the four policy passes run by an independent read-only subagent; synthesis by the authoring session)
Files changed: 13
Overview
The branch removes the on-disk sort-sequence cache: the
<clerkId>_SortSeq.fwssfiles thatRecordBrowseViewwrote into the language project'sTempfolder on dispose, the read attempt inRecordView.InitBasewhen a clerk was created, the serializer in Filters, and the purges of that folder inFwXWindow,ReversalClerk.OnPropertyChanged,FLExBridgeListenerandInterestingTextList. The restore has returnedfalseunconditionally since the 2015 Db4o removal (ddf9648) cut the lines that installed the restored list, so no FieldWorks 9 release ever restored a list from it.The analysis verified that claim against the 2015 diff, found no Critical or Important issues, and confirmed that the two candidate surviving side effects (the
m_prevFlidassignment inEntriesOrChildClassesRecordList.RestoreFrom, and the creation and wholesale deletion of theTempfolder) leave no behavioural trace. Developer-only change: no Jira ticket needed. The only thing a tester could observe is the absence of new.fwssfiles in a language project'sTempfolder.Contract/API Changes
IManyOnePathSortItem.PersistDataremoved from the interface;ManyOnePathSortItem.PersistData,WriteItems,ReadItems, the internalLazyManyOnePathSortItemandInvalidObjectGuidExceptionremoved.XWindow.DiscardProperties(protected virtual) removed. Its only override wasFwXWindow; its only callers wereRestoreWindowSettings(Shift at startup, or the safe-mode prompt answered Yes) andFwXWindow.ClearInvalidatedStoredData, whose callers inFLExBridgeListener.RefreshCacheWindowAndAllandReversalClerk.OnPropertyChangedare removed too.RecordView.PersistSortSequence(protected virtual), theRecordBrowseView.OnParentChangedoverride, and the internalRecordClerk.PersistListOn,RecordClerk.RestoreListFrom,ListUpdateHelper.ListWasRestored,RecordList.PersistOn,RecordList.RestoreFromandRecordView.GetSortFilePersistPathname.<language project>\Temp\<clerkId>_SortSeq.fwssis no longer written, read or deleted;<language project>\Tempis no longer created on clerk creation nor deleted wholesale.Findings
Critical - Must address before merge
None.
Important - Should address before merge
None.
Minor - Consider
(The assertion guarded the clerk-id table that existed only to choose which cache files to delete. With the table gone there is nothing left to assert, so it goes with the mechanism.)Src/xWorks/InterestingTextList.cs: the removedInvalidateRelatedSortSequencesalso carriedDebug.Fail("We may need to add a new RelatedClerkId."), which fired in Debug builds when the texts changed while a clerk outside the four listed ids was active. Release behaviour unchanged; the commit message does not mention dropping the assertion.(The constant is liblcm's and still names the language project'sSrc/FwCoreDlgs/FwDeleteProjectDlg.cs:303,334: still uses liblcm'sLcmFileHelper.ksSortSequenceTempDir, whose name is now misleading. Harmless: it deletes or ignores the folder and tolerates its absence.Tempfolder, which Send/Receive uses for its schema copy. Renaming it and dropping liblcm'sProjectRestoreServicesweep of*.fwssis a liblcm follow-up, not this PR.)Required Validation / Evidence
.\build.ps1 -CommentHygiene -TokenHygiene -StartedBy agent: build succeeded, 0 warnings, 0 errors, both hygiene gates clean..\test.ps1 -CommentHygiene -TokenHygiene -SkipNative -StartedBy agent -TestProject xWorksTests: 1779 total, 1777 passed, 2 skipped, the same counts as main. CoversBulkEditBarTests,RecordListTestsandInterestingTextsTests..\test.ps1 -CommentHygiene -TokenHygiene -SkipNative -NoBuild -StartedBy agent -TestProject FiltersTests: 24 passed. The two removed tests covered only the serializer round trip and bad-GUID rejection.Temp\*_SortSeq.fwss): not performed.LexEdDllTestsandxCoreTests: not run. The reviewer found nothing in them that reaches the removed paths;XWorksAppTestBasecallsRestoreWindowSettings(false), which never reached the removed branch.Positive Observations
git show ddf964846 -- Src/xWorks/RecordList.csreplaced them_sortedObjects = items ... return truetail ofRestoreFromwithreturn false; the only override returnedbase, soRestoreListFromnever returned true andListWasRestoredwas unreachable. TheInitBasesimplification is exact.m_prevFlid: the removed assignment ran beforeRecordBrowseView.InittriggersOnChangeListItemsClass, which assignsm_prevFlid = m_fliditself before changingm_flid; while the class is unchanged the only reader,GetNewCurrentIndex, returns -1 either way.Tempfolder: the only other writer,FLExBridgeListener.CopyDictionaryConfigFileToTemp, creates the folder itself and removes its file throughTempFile. DroppingRobustIO.DeleteDirectoryAndContents(Temp)on every reversal-clerkPropertyChangedis strictly safer for that copy.Src(including the six UTF-16 files),DistFiles,DocsorBuild.GlobalSettingServices.PersistDatais an unrelatedHomographConfigurationmember.OnParentChangedoverride reachedPersistSortSequencethrough theClerkgetter, which creates a clerk when none exists; its removal closes a clerk-creation path during teardown.InterestingTextList.Cachedoc comment is accurate: assigned only inGetCache()from the property table, read only byPropChanged'sVirtuals.LangProjTextscheck.ManyOnePathSortItemconstruction, key and path semantics stay covered byTestManyOneBrowse,FindResultsSorterTests,OccurrenceInContextFinderTests,RecordListTests,WordsUsedOnlyElsewhereFilterTests,ItemClickedTestsandInterlinearTextRecordClerkTests.Interview Notes
m_prevFlid) was traced throughRecordBrowseView.Initand found masked; the post-Send/Receive purge ran after the schema copy's scope had closed.InterestingTextList, which the initial reference sweep had hidden behind its own exclusion filter. Its LT-13217 invalidation of related clerks' cache files is the same dead mechanism and was removed; a UTF-16-aware re-sweep found nothing else..fwssfiles in users'Tempfolders are left in place (no startup sweep); liblcm's constant and*.fwssrestore sweep are untouched;FwDeleteProjectDlgis untouched. TheXWindow.DiscardPropertieshook was removed with its only override.In-Review Quality Check
No in-review changes.
Suggested Review Focus
RecordView.InitBase: the restored-list branch is gone and the load-if-needed condition lost only the restored flag.EntriesOrChildClassesRecordList: removal of the override that setm_prevFlid.FwXWindowandXWindow: removal ofDiscardPropertiesandClearInvalidatedStoredData, and theTempfolder's remaining user.IManyOnePathSortItem.PersistData: public interface member removed.🤖 Generated with Claude Code
This change is