Skip to content

Commit afbd071

Browse files
committed
fix(google-vault): defensively order mutually-exclusive scope spreads
Greptile: savedQueryAccountEmails/savedQueryOrgUnitId spread after their updateHold* counterparts, so if both were ever truthy at once the wrong one would silently win. In practice they're mutually exclusive (each only populated while its own single 'operation' value is selected, so at most one pair is ever truthy), but reordering costs nothing and removes any doubt about precedence.
1 parent efdfc68 commit afbd071

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

apps/sim/blocks/blocks/google_vault.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -740,10 +740,14 @@ Return ONLY the description text - no explanations, no quotes, no extra text.`,
740740
// Map operation-scoped fields (kept separate in the UI so a stale value from
741741
// another operation can never silently override these) to their tool parameter names
742742
...(listMatterId && { matterId: listMatterId }),
743-
...(updateHoldAccountEmails && { accountEmails: updateHoldAccountEmails }),
744-
...(updateHoldOrgUnitId && { orgUnitId: updateHoldOrgUnitId }),
743+
// These operation-scoped accountEmails/orgUnitId fields are mutually exclusive —
744+
// each is only ever populated while its own single 'operation' value is selected,
745+
// so at most one of the four spreads below is ever truthy at once. Ordered here
746+
// defensively anyway so precedence stays correct even if that invariant changes.
745747
...(savedQueryAccountEmails && { accountEmails: savedQueryAccountEmails }),
746748
...(savedQueryOrgUnitId && { orgUnitId: savedQueryOrgUnitId }),
749+
...(updateHoldAccountEmails && { accountEmails: updateHoldAccountEmails }),
750+
...(updateHoldOrgUnitId && { orgUnitId: updateHoldOrgUnitId }),
747751
...(listExportId && { exportId: listExportId }),
748752
...(listHoldId && { holdId: listHoldId }),
749753
...(listSavedQueryId && { savedQueryId: listSavedQueryId }),

0 commit comments

Comments
 (0)