Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix]: Clear mods by code data before (re)loading to prevent duplicate key errors #368

Merged

Conversation

JonathanFeenstra
Copy link
Contributor

LoadAsync clears the ModViewModels and Mods collections, but not modsByCode which is also filled in this method.

In practice, LoadAsync currently only runs once when the EngineView is loaded, so the duplicate key errors don't actually occur in normal usage. However, if you're already clearing ModViewModels and Mods to prevent similar issues when it's called multiple times, you should clear modsByCode as well. Doing so could still be useful if you for example want to benchmark the method.

@Monitor221hz Monitor221hz merged commit b99c519 into Monitor221hz:main Dec 1, 2024
1 check passed
@JonathanFeenstra JonathanFeenstra deleted the fix-loadasync-duplicatekey branch December 1, 2024 18:56
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.

2 participants