Fix Newly Compatible filter with repo autoupdate #2734
Merged
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.
Problem
If you have repository auto updates enabled, then the Newly Compatible filter will show all modules:
Cause
Before #2694, GUI performed two mod list updates at startup if repository auto updates were enabled: one with the existing registry data (which the user will never see), and one with the registry data after the repo update. This is not great because mod list updates are one of our slower operations.
After #2694, GUI performed only one mod list update at startup, using the data after the repo update. This improved performance, but it broke the Newly Compatible filter because that filter was based on a comparison of the mod list before and after the repo update. With only do one mod list update, the "before" list in the comparison is empty, and every mod seems to be newly added.
Changes
Now the "before" part of the before-and-after comparison is generated based on the registry before the repositories are updated, and then passed to the mod list updating code after the repo update. This allows us to populate the filter properly without performing multiple mod list updates.
Fixes #2716.