fix(llmo-4010): preserve edgeDeployed flag when patching suggestion data#2172
Draft
fix(llmo-4010): preserve edgeDeployed flag when patching suggestion data#2172
Conversation
patchSuggestion was calling suggestion.setData(data) with the incoming request body, which overwrote the edgeDeployed flag set by the audit runner. Now merges incoming data over existing data while preserving the edgeDeployed field from the stored suggestion. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
This PR will trigger a patch release when merged. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aims to prevent the suggestion.data.edgeDeployed flag (set by the audit runner after edge deployment) from being unintentionally cleared when the LLMO UI performs partial PATCH updates to a suggestion.
Changes:
- Updates
patchSuggestionto derive a newdatapayload based on existing suggestion data and incoming patch data, attempting to preserveedgeDeployed.
Comment on lines
+666
to
+669
| const mergedData = { ...data }; | ||
| if (existingData.edgeDeployed != null) { | ||
| mergedData.edgeDeployed = existingData.edgeDeployed; | ||
| } |
| suggestion.setData(data); | ||
| const existingData = suggestion.getData() || {}; | ||
| const mergedData = { ...data }; | ||
| if (existingData.edgeDeployed != null) { |
Comment on lines
663
to
+670
| if (data) { | ||
| hasUpdates = true; | ||
| suggestion.setData(data); | ||
| const existingData = suggestion.getData() || {}; | ||
| const mergedData = { ...data }; | ||
| if (existingData.edgeDeployed != null) { | ||
| mergedData.edgeDeployed = existingData.edgeDeployed; | ||
| } | ||
| suggestion.setData(mergedData); |
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.
Summary
patchSuggestion, when updatingsuggestion.data, the existingedgeDeployedflag was being silently overwritten with whatever the caller sent (orundefinedif they didn't include it)dataover existing data while preservingedgeDeployedfrom the stored suggestionRoot Cause
The audit runner sets
suggestion.data.edgeDeployed = trueafter successfully deploying a suggestion to the edge. When the LLMO UI later callsPATCH /suggestions/:idto update other fields (e.g. rank, status), it sends a partialdataobject withoutedgeDeployed, which overwrote the flag.Test plan
PATCH /suggestions/:idwith{ data: { someField: 'value' } }preserves existingedgeDeployedon the suggestionPATCH /suggestions/:idwith{ data: { edgeDeployed: false } }still allows explicitly settingedgeDeployedFixes LLMO-4010
🤖 Generated with Claude Code