Repository navigation
Fix LT-22834: keep multi-string alternatives in writing systems not yet known to the cache - #406
Open
johnml1135 wants to merge 2 commits into
Open
johnml1135 wants to merge 2 commits into
johnml1135 wants to merge 2 commits into
Conversation
… kept Loading an AUni alternative whose writing system the cache has not seen yet currently drops the alternative, because the lookup returns 0 for unknown writing systems. AStr runs create the writing system on demand, so the result depends on activation order. This test fails until AUni does the same. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…et known to the cache MultiUnicodeAccessor looked AUni alternatives up with GetWsFromStr, which returns 0 for a writing system the cache has not seen, so the alternative was silently dropped. AStr runs create the writing system on demand, so the outcome depended on activation order. AUni alternatives now resolve the writing system the same way runs do. No schema or file-format change. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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.
Fixes LT-22834. A multilingual (
AUni) alternative in a writing system the cache has not seen yet is no longer dropped on load. Whether it survived used to depend on which objects happened to be activated first.Cause.
MultiUnicodeAccessor.ReadMultiUnicodeAlternativeresolved the alternative'swswithGetWsFromStr, which returns 0 for an unknown writing system, so the alternative was discarded.AStrruns resolve throughTsStringSerializer.GetWsForId→get_Engine, which creates the writing system on demand. So anAUnivalue survived only if some run in that writing system had already been read. In the Sena sample, lazy activation kept 4,515 of 4,599ChkTerm.NameHebrew values, while activation in file order kept all of them. In Indonesian,fr/esvalues that occur only inAUnifields were always dropped.Fix. Resolve
AUniwriting systems withget_Engine, as runs do. One deliberate difference: an identifier that cannot become a writing system is still dropped rather than throwing, which keeps this path's existing "don't block opening the project" behaviour. The writing system is created in the cache's writing-system manager only; nothing is added to the project's vernacular or analysis lists. No schema, model version, persisted field or file format changes.Tests.
ReadMultiUnicodeAlternative_UnknownWritingSystem_IsKept, committed alone first. It fails before the fix ("alternative in an unknown writing system was dropped") and passes after.SIL.LCModel.Tests1,717 passed / 0 failed / 18 skipped, andSIL.LCModel.Core.Tests775 / 0 / 14. net462 was not run.Worth a FieldWorks reviewer's eye: loading a project can now create writing systems in the cache's writing-system manager for identifiers found only in
AUnidata, as loadingAStrruns already does. If FLEx should treat such writing systems differently, for example by warning, that belongs in a follow-up.Related: #405 (a cross-cache HVO collision found in the same investigation).
🤖 Generated with Claude Code
This change is