Closed megahirt closed 3 years ago
Here is the offending line. It assumes that additions to the dictionary are always unique, but for whatever reason there is a duplicate coming out of LcmWs
. I suggest wrapping this in an if statement that continues the loop if the key already exists in the dictionary.
lfWsList.Add(LcmWs.LanguageTag, lfWs);
That is surprising behavior from a C# dictionary in my opinion. I would have expected .Add()
to replace an existing value, not throw an exception. I just looked it up and found that where dict.Add(key, value)
throws if key
already exists, dict[key] = value
does not throw, but replaces the value as I would have expected. So this fix will be simple.
I figured you would know a better way than to add an if statement. Thanks. Of course I don't understand how the FLEx project data has duplicate WS (same language tag) but we can't chase down every unexpected thing in FW and instead make LFMerge more robust.
Agreed. I'm not going to chase down why there are two WSes with the same tag; I'm just going to let one of them overwrite the other and move on. If it happens to be the "wrong" one that arrives second and "wins", then the project's Mercurial repo will contain its history in enough detail that some tech support person (probably me) can sort it out manually later on.
Will be fixed by https://github.com/sillsdev/LfMerge/pull/140 and https://github.com/sillsdev/LfMerge/pull/141 once they're merged and released.
I agree with not trying to track it down right now. I'm not looking to change your priorities, however, it might be useful to know if it is because the same language appears both the vernacular and analysis lists.
Jason, that's a really good point that I hadn't thought of that seems likely, especially if lcmWs is a joined collection of analysis and vernacular WSs. Thanks for that insight.
Just did a very quick check, and the kap
writing system is only listed as a vernacular system in the current version (Mercurial tip) of the project. However, the Language Forge project at the time of the failed Send/Receive was about 60 commits back from the tip, and it's possible that the commit the LF project was at had kap
in the analysis writing system list due to a mistake that was later corrected. I don't want to spend the time to check that theory now, but this is a note to myself to check on that once I finish my current work.
@rmunn 's fix shipped yesterday in v1.9 and so I did a sync just now and it succeeded - nice work Robin!
Project code: kap-flex
Error message:
User reported via issues@languageforge.org