Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 24, 2025

The CanSyncRandomEntries test fails intermittently with LcmInvalidFieldException: Fieldname 'Affixes' does not exist when entries with certain morph types have complex form components.

Root Cause

LibLCM bug: LexEntry.get_VisibleComplexFormBackRefs() attempts to access an "Affixes" field that doesn't exist for entries using IMoAffixAllomorph internal structures (affix morph types: Prefix, Suffix, Infix, Circumfix, Simulfix, Suprafix, *Interfix variants).

Note: The original error showed MorphType = Enclitic, but Enclitic is actually treated as a stem type in the codebase, not an affix type. This suggests the error conditions are more complex than initially understood.

Stack trace:
at SIL.LCModel.DomainImpl.LexEntry.get_VisibleComplexFormBackRefs()
at SIL.LCModel.DomainImpl.LexEntryRef.UpdateComplexFormEntryBackRefs()
at SIL.LCModel.DomainImpl.LexEntry.AddComponent()

Changes

Added a single targeted test method to isolate triggering conditions:

  • CanCreateAffixEntryWithComplexFormComponents: Tests affix MorphType (Prefix) entry with both components and complex forms

Test currently passes, indicating the error requires additional conditions not yet identified, likely:

  • Specific ordering of operations during sync
  • Pre-existing complex form relationships or state
  • Combination of morph types between related entries (component vs. complex form)
  • Round-trip transformation details

Next Steps

This is a LibLCM library bug requiring either:

  1. Upstream fix in SIL.LCModel
  2. Workaround in FwDataMiniLcmApi (detect problematic combinations, reorder operations, or catch/handle gracefully)

The test provides a foundation for reproduction once the specific triggering conditions are identified.

Original prompt

This section details on the original issue you should resolve

<issue_title>CanSyncRandomEntries failure: Fieldname 'Affixes' does not exist</issue_title>
<issue_description>Note that this occurred when testing the FwData API and using the FwData API for round-tripping.
I assume it has something to do with Morph Types.

Error: MiniLcm.Exceptions.CreateObjectException : Failed to create entry Entry { Id = f1d74029-2323-580f-00e2-96d1867f097b, DeletedAt = , LexemeForm = fr: cross-media, en: Lane, CitationForm = fr: transmit, es: input, en: forecast, LiteralMeaning = fr: MiniLcm.Models.RichString, es: MiniLcm.Models.RichString, MorphType = Enclitic, Senses = System.Collections.Generic.List1[MiniLcm.Models.Sense], Note = fr: MiniLcm.Models.RichString, en: MiniLcm.Models.RichString, Components = System.Collections.Generic.List1[MiniLcm.Models.ComplexFormComponent], ComplexForms = System.Collections.Generic.List1[MiniLcm.Models.ComplexFormComponent], ComplexFormTypes = System.Collections.Generic.List1[MiniLcm.Models.ComplexFormType], PublishIn = System.Collections.Generic.List`1[MiniLcm.Models.Publication] }
---- SIL.LCModel.LcmInvalidFieldException : Fieldname 'Affixes' does not exist. Consider using a decorator or review the fieldname for typos.

Failed FwLiteProjectSync.Tests.CrdtEntrySyncTests.CanSyncRandomEntries(roundTripApiType: FwData) [2 s]
Error Message:
MiniLcm.Exceptions.CreateObjectException : Failed to create entry Entry { Id = f1d74029-2323-580f-00e2-96d1867f097b, DeletedAt = , LexemeForm = fr: cross-media, en: Lane, CitationForm = fr: transmit, es: input, en: forecast, LiteralMeaning = fr: MiniLcm.Models.RichString, es: MiniLcm.Models.RichString, MorphType = Enclitic, Senses = System.Collections.Generic.List1[MiniLcm.Models.Sense], Note = fr: MiniLcm.Models.RichString, en: MiniLcm.Models.RichString, Components = System.Collections.Generic.List1[MiniLcm.Models.ComplexFormComponent], ComplexForms = System.Collections.Generic.List1[MiniLcm.Models.ComplexFormComponent], ComplexFormTypes = System.Collections.Generic.List1[MiniLcm.Models.ComplexFormType], PublishIn = System.Collections.Generic.List1[MiniLcm.Models.Publication] } ---- SIL.LCModel.LcmInvalidFieldException : Fieldname 'Affixes' does not exist. Consider using a decorator or review the fieldname for typos. Stack Trace: at FwDataMiniLcmBridge.Api.FwDataMiniLcmApi.CreateEntry(Entry entry, CreateEntryOptions options) in D:\a\languageforge-lexbox\languageforge-lexbox\backend\FwLite\FwDataMiniLcmBridge\Api\FwDataMiniLcmApi.cs:line 1009 at FwLiteProjectSync.Tests.EntrySyncTestsBase.CanSyncRandomEntries(Nullable1 roundTripApiType) in D:\a\languageforge-lexbox\languageforge-lexbox\backend\FwLite\FwLiteProjectSync.Tests\EntrySyncTests.cs:line 194
--- End of stack trace from previous location ---
----- Inner Stack Trace -----
at SIL.LCModel.Infrastructure.Impl.LcmMetaDataCache.GetFieldId2(Int32 clid, String fieldName, Boolean includeBaseClasses)
at SIL.LCModel.DomainServices.VirtualOrderingServices.CheckParentAndGetFieldName(ICmObject parent, Int32 flid)
at SIL.LCModel.DomainServices.VirtualOrderingServices.GetOrderedValue(ICmObject parent, Int32 flid, IEnumerable1 unmodifiedSeq) at SIL.LCModel.DomainServices.VirtualOrderingServices.GetOrderedValue[T](ICmObject parent, Int32 flid, IEnumerable1 unmodifiedSeq)
at SIL.LCModel.DomainImpl.LexEntry.get_VisibleComplexFormBackRefs()
at SIL.LCModel.DomainImpl.LexEntryRef.UpdateComplexFormEntryBackRefs(ICmObject thingAddedOrRemoved, Boolean fAdded)
at SIL.LCModel.DomainImpl.LexEntryRef.AddObjectSideEffectsInternal(AddObjectEventArgs e)
at SIL.LCModel.DomainImpl.CmObject.SIL.LCModel.ICmObjectInternal.AddObjectSideEffects(AddObjectEventArgs e)
at SIL.LCModel.DomainImpl.LcmList1.AddObject(AddObjectEventArgs args) at SIL.LCModel.DomainImpl.LcmReferenceSequence1.AddObject(AddObjectEventArgs args)
at SIL.LCModel.DomainImpl.LcmList1.Add(T obj) at SIL.LCModel.DomainImpl.LexEntry.AddComponent(ICmObject other) at FwDataMiniLcmBridge.Api.FwDataMiniLcmApi.InsertComplexFormComponent(ILexEntry lexComplexForm, ICmObject lexComponent, BetweenPosition1 between) in D:\a\languageforge-lexbox\languageforge-lexbox\backend\FwLite\FwDataMiniLcmBridge\Api\FwDataMiniLcmApi.cs:line 1112
at FwDataMiniLcmBridge.Api.FwDataMiniLcmApi.AddComplexFormComponent(ILexEntry lexComplexForm, ComplexFormComponent component, BetweenPosition`1 between) in D:\a\languageforge-lexbox\languageforge-lexbox\backend\FwLite\FwDataMiniLcmBridge\Api\FwDataMiniLcmApi.cs:line 1096
at FwDataMiniLcmBridge.Api.FwDataMiniLcmApi.<>c__DisplayClass125_0.b__0() in D:\a\languageforge-lexbox\languageforge-lexbox\backend\FwLite\FwDataMiniLcmBridge\Api\FwDataMiniLcmApi.cs:line 996
at SIL.LCModel.Infrastructure.UndoableUnitOfWorkHelper.Do(String undoText, String redoText, IActionHandler actionHandler, Action task)
...


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@coderabbitai
Copy link

coderabbitai bot commented Nov 24, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI and others added 2 commits November 24, 2025 09:45
Added tests to pinpoint which morph types and entry configurations cause issues with complex form components. Tests cover:
- All morph types with components
- Affix morph types as components
- Affix morph types with both components and complex forms

These tests help identify the specific conditions that trigger the "Affixes" field error.

Co-authored-by: myieye <[email protected]>
Added more targeted tests to identify the "Affixes" field error:
- Tests for adding components to existing affix entries
- Tests for using affix entries as components
- Tests verify back-references are created correctly

All targeted tests pass individually, indicating the error is specific to random data combinations in CanSyncRandomEntries test.

Co-authored-by: myieye <[email protected]>
Copilot AI changed the title [WIP] Fix CanSyncRandomEntries failure due to missing 'Affixes' field Add comprehensive tests to pinpoint "Affixes" field error with affix morph types Nov 24, 2025
Copilot finished work on behalf of myieye November 24, 2025 09:52
Copilot AI requested a review from myieye November 24, 2025 09:52
@myieye
Copy link
Collaborator

myieye commented Nov 24, 2025

@copilot I think there's likely a combination of morph type and component/complex-form relationship (the Morph Type of both the component and complex-form are likely relevant) that consistently triggers this exception. I'm not looking for lots of tests I just want 1 simple test that triggers the exception.

Try again.

…ld error

Simplified to one test that attempts to reproduce the error with an affix MorphType (Prefix) entry having both components and complex forms. Test currently passes, indicating the error requires additional conditions not yet identified in the random test scenario.

Co-authored-by: myieye <[email protected]>
Copy link
Contributor Author

Copilot AI commented Nov 24, 2025

@copilot I think there's likely a combination of morph type and component/complex-form relationship (the Morph Type of both the component and complex-form are likely relevant) that consistently trigge...

Replaced all tests with a single focused test (CanCreateAffixEntryWithComplexFormComponents) targeting the exact scenario: an affix MorphType (Prefix) entry with both components and complex forms (commit 6b66e64).

However, the test passes consistently, indicating the error requires additional conditions beyond what I could identify. The original error showed MorphType = Enclitic, but Enclitic is actually treated as a stem type in the code, not an affix type (only Prefix, Suffix, Infix, Circumfix, Simulfix, Suprafix, and *Interfix variants use IMoAffixAllomorph).

The intermittent nature of the failure in the random test suggests it may depend on:

  • Specific ordering of create/update operations during sync
  • Pre-existing complex form relationships or state
  • Combination of morph types between related entries (component vs. complex form)
  • Round-trip transformation details

Would you be able to provide more details from a failing test run (e.g., the actual entry data that triggers it, or a seed value for the random generator)?

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • ldml.api.sil.org
    • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/languageforge-lexbox/languageforge-lexbox/backend/FwLite/FwLiteProjectSync.Tests/bin/Debug/net9.0/FwLiteProjectSync.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/languageforge-lexbox/languageforge-lexbox/backend/FwLite/FwLiteProjectSync.Tests/bin/Debug/net9.0/FwLiteProjectSync.Tests.deps.json /home/REDACTED/work/languageforge-lexbox/languageforge-lexbox/backend/FwLite/FwLiteProjectSync.Tests/bin/Debug/net9.0/testhost.dll --port 36867 --endpoint 127.0.0.1:036867 --role client --parentprocessid 4037 --telemetryoptedin false (dns block)
    • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/languageforge-lexbox/languageforge-lexbox/backend/FwLite/FwLiteProjectSync.Tests/bin/Debug/net9.0/FwLiteProjectSync.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/languageforge-lexbox/languageforge-lexbox/backend/FwLite/FwLiteProjectSync.Tests/bin/Debug/net9.0/FwLiteProjectSync.Tests.deps.json /home/REDACTED/work/languageforge-lexbox/languageforge-lexbox/backend/FwLite/FwLiteProjectSync.Tests/bin/Debug/net9.0/testhost.dll --port 36257 --endpoint 127.0.0.1:036257 --role client --parentprocessid 4244 --telemetryoptedin false (dns block)
    • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/languageforge-lexbox/languageforge-lexbox/backend/FwLite/FwLiteProjectSync.Tests/bin/Debug/net9.0/FwLiteProjectSync.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/languageforge-lexbox/languageforge-lexbox/backend/FwLite/FwLiteProjectSync.Tests/bin/Debug/net9.0/FwLiteProjectSync.Tests.deps.json /home/REDACTED/work/languageforge-lexbox/languageforge-lexbox/backend/FwLite/FwLiteProjectSync.Tests/bin/Debug/net9.0/testhost.dll --port 39175 --endpoint 127.0.0.1:039175 --role client --parentprocessid 4431 --telemetryoptedin false (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title Add comprehensive tests to pinpoint "Affixes" field error with affix morph types Add test attempting to reproduce "Affixes" field error with affix morph types Nov 24, 2025
Copilot finished work on behalf of myieye November 24, 2025 10:23
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.

CanSyncRandomEntries failure: Fieldname 'Affixes' does not exist

2 participants