Repository navigation
GH Issue 1736: Keep calculated fields when renaming a sample type - #8186
Merged
Merged
Conversation
- MetadataTableJSON.saveMetadata: set the updated query name on the QueryDef before saving, and use it for a new QueryDef row and new XML table - QueryDefCache.uncache: also clear the folder's cache after commit/rollback, not just immediately - QueryServiceImpl.TestCase: add a test that reloads the cache from another thread mid-rename
XingY
reviewed
Oct 16, 2026
| TableInfo rawTableInfo = getRawTableInfo(schema, queryName, updatedQueryName); | ||
| TablesDocument doc = null; | ||
| TableType xmlTable = null; | ||
| String savedQueryName = updatedQueryName != null ? updatedQueryName : queryName; |
Contributor
There was a problem hiding this comment.
Debugging reveals that QueryManager.get().getQueryDef returns the queryDef under a different casing. So if a "Blood" sample type is renamed to "blood", QueryManager.get().getQueryDef("blood") returns the cached def for "Blood". This is probably harmless, especially for sample types since we don't allow casing different sample types.
XingY
approved these changes
Oct 16, 2026
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.
Rationale
Renaming a sample type shortly after editing it could lose its calculated fields (GH Issue 1736). During the save, a background thread (e.g. search indexing) could reload the query metadata cache with the pre-rename row, and the calculated-field save then wrote that stale row back over the rename.
Related Pull Requests
Changes