Repository navigation
#2601 warn before changeKeyField key collision causes a deploy error - #2673
Open
Pushpak731 wants to merge 2 commits into
Open
Pushpak731 wants to merge 2 commits into
Pushpak731 wants to merge 2 commits into
Conversation
…oy error When --changeKeyField derives a new key that is already used by a DIFFERENT cached item, the deploy would previously fail with a cryptic 'already exists' API error. The collision is now detected before the key change, logging a clear error and skipping the change for that item.
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.
PR details
What changes did you make? (Give an overview)
When
--changeKeyFieldderives a new key that is already used by a different cached item, the deploy previously failed with a cryptic "already exists" API error (the root cause of the intermittent failure reported in #2601). The collision is now detected before the key change: a clear error is logged naming the conflicting key, and the change is skipped for that item, allowing the rest of the deploy to proceed.Further details (optional)
The check in
MetadataType.createOrUpdatelooks up the derived key in the cache viacache.getByKey(type, newKey)before overwritingmetadataMap[metadataKey][keyField]. If a different cached item already owns that key, the item is flagged withhasError = trueand the key is left unchanged — the same skip mechanism already used for GUID keys and fixed-key types. When the derived key is free (or belongs to the same item, i.e. is already the current key), the change proceeds as before.Checklist