Repository navigation
Fix slow lookup suggestions when editing game configuration - #1253
Merged
Merged
Conversation
When a lookup field was bound to the context of the game configuration data source (e.g. merchant stores, item drops, config edit pages), the suggestions were queried from the database on every keystroke, loading the whole object graph into a context which already tracks the complete configuration. Now the already loaded objects of the data source are used in that case. Fixes #1223 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018GYsgGD7aoTDMXciEfStgZ
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 #1223
Problem
PersistentObjectsLookupController.GetSuggestionsAsynconly used the already loaded objects of the game configuration data source when the passed context did not support the searched type. Pages like Merchants, item drops, cash shop and the config edit pages pass the data source's own context, which supports every configuration type. So on every keystroke the lookup rancontext.GetAsync<T>(), loading the whole object graph (e.g. all item definitions) from the database into a context that already tracks the complete game configuration. That's what pegged one core for up to minutes.Fix
If the passed context is the game configuration data source's own context, the suggestions now come from
GetAll<T>()on the already loaded configuration. These are the same tracked instances, so assigning a selected object still works. Other contexts (e.g. typed contexts created for non-config edits) are still queried as before.Testing
PersistentObjectsLookupControllerTests. The new test fails without the fix and passes with it.MUnique.OpenMU.Web.Testspass.Generated by Claude Code