Fix bug that occurs when re-adding version metadata after removing all keys#8887
Merged
Fix bug that occurs when re-adding version metadata after removing all keys#8887
Conversation
Shivs11
approved these changes
Dec 22, 2025
simvlad
pushed a commit
that referenced
this pull request
Feb 2, 2026
…l keys (#8887) ## What changed? Fix bug that occurs when re-adding version metadata after removing all keys ## Why? Because otherwise, users could break their version workflow. Luckily, this won't happen to users of the worker controller, because there are certain metadata keys added to all versions managed by the worker controller. ## How did you test it? - [x] built - [x] run locally and tested manually - [ ] covered by existing tests - [ ] added new unit test(s) - [x] added new functional test(s) ## Potential risks - None <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Ensure version metadata can be re-added after removing all keys by reinitializing maps and using nil-safe deletes, with new test coverage. > > - **Backend (worker deployment)**: > - In `service/worker/workerdeployment/version_workflow.go`, initialize `VersionState.Metadata` and `Metadata.Entries` when `UpsertEntries` is provided, and use `Metadata.GetEntries()` for deletes to be nil-safe. > - **Tests**: > - Extend `TestUpdateVersionMetadata` to remove all entries then re-upsert and validate; minor assertion update to `s.Len`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 47680a7. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
awln-temporal
pushed a commit
that referenced
this pull request
Feb 6, 2026
…l keys (#8887) Fix bug that occurs when re-adding version metadata after removing all keys Because otherwise, users could break their version workflow. Luckily, this won't happen to users of the worker controller, because there are certain metadata keys added to all versions managed by the worker controller. - [x] built - [x] run locally and tested manually - [ ] covered by existing tests - [ ] added new unit test(s) - [x] added new functional test(s) - None <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Ensure version metadata can be re-added after removing all keys by reinitializing maps and using nil-safe deletes, with new test coverage. > > - **Backend (worker deployment)**: > - In `service/worker/workerdeployment/version_workflow.go`, initialize `VersionState.Metadata` and `Metadata.Entries` when `UpsertEntries` is provided, and use `Metadata.GetEntries()` for deletes to be nil-safe. > - **Tests**: > - Extend `TestUpdateVersionMetadata` to remove all entries then re-upsert and validate; minor assertion update to `s.Len`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 47680a7. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
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.
What changed?
Fix bug that occurs when re-adding version metadata after removing all keys
Why?
Because otherwise, users could break their version workflow.
Luckily, this won't happen to users of the worker controller, because there are certain metadata keys added to all versions managed by the worker controller.
How did you test it?
Potential risks
Note
Ensure version metadata can be re-added after removing all keys by reinitializing maps and using nil-safe deletes, with new test coverage.
service/worker/workerdeployment/version_workflow.go, initializeVersionState.MetadataandMetadata.EntrieswhenUpsertEntriesis provided, and useMetadata.GetEntries()for deletes to be nil-safe.TestUpdateVersionMetadatato remove all entries then re-upsert and validate; minor assertion update tos.Len.Written by Cursor Bugbot for commit 47680a7. This will update automatically on new commits. Configure here.