Skip to content

Commit 67d1e72

Browse files
committed
fix(google-vault): fail loudly instead of silently clearing hold scope on update
Cursor Bugbot: PUT holds/{id} replaces the full resource — a name/query-only update with no accountEmails/orgUnitId would silently drop the hold's custodian coverage. Now throws a clear error directing callers to resend the scope or use add_held_accounts/remove_held_accounts for incremental changes.
1 parent 5e0b616 commit 67d1e72

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

apps/sim/tools/google_vault/update_matters_holds.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,12 @@ export const updateMattersHoldsTool: ToolConfig<GoogleVaultUpdateMattersHoldsPar
117117
body.accounts = emails.map((email: string) => ({ email }))
118118
} else if (params.orgUnitId) {
119119
body.orgUnit = { orgUnitId: params.orgUnitId }
120+
} else {
121+
throw new Error(
122+
'Updating a hold replaces its full scope: re-provide the current Account Emails or Org Unit ID ' +
123+
'(they are not preserved automatically). To add or remove individual custodians without ' +
124+
'resending the full scope, use Add Held Accounts / Remove Held Accounts instead.'
125+
)
120126
}
121127

122128
if (params.corpus === 'MAIL' || params.corpus === 'GROUPS') {

0 commit comments

Comments
 (0)