Skip to content

Bug: Bulk delete bypasses the synced-contact restriction enforced by row actions #3623

Closed

Description

@yannickmonney

P2 · Reproduced locally against 44e0dcf254975286c0e9dea443b5cd1ca6b23347. No production testing.

A synced contact that is deliberately protected from ordinary UI edits/deletion can be removed by selecting its checkbox. Row actions and bulk actions give contradictory protections.

Reproduction:

  1. As an Editor or higher, have a synced contact such as source salesforce.
  2. Open its row menu: View is present; Edit and Delete are correctly absent.
  3. Select that same contact with its row checkbox → Delete selected → confirm Delete.
  4. Reload Contacts or read the contact by id.

Expected: Bulk deletion uses the same source eligibility rule as single-row deletion. Synced contacts whose source owns the record cannot be deleted through a second UI path.

Observed: The real ContactsTable invokes deleteContact for the Salesforce record. Its app DELETE endpoint answers success and the real PostgreSQL readback is lifecycleStatus trashed.

Cause: ContactsTable enables selection for every row and sends selected ids directly to BulkDeleteBar. It never applies isEditableContact or the row-action eligibility predicate.

Frozen observation/control output:

SYNCED_BULK_DELETE {"source":"salesforce","editable":false,"rowMenuDelete":false,"bulkDeleteCalled":true}
SYNCED_CONTACT_DELETE {"source":"salesforce","httpStatus":200,"response":{"ok":true},"readbackLifecycleStatus":"trashed"}
SYNCED_BULK_CONTROL {"source":"manual_import","rowMenuDelete":true}

Control: The real row menu exposes Delete on a manual_import contact and hides it on salesforce. The manual test oracle explicitly says contact edit/delete are offered only on manually created rows.

Exact component probe command:

/Users/yannick/.npm/_npx/22f2fe8d8bc13000/node_modules/.bin/bun x vitest run --config /Users/yannick/.codex/notes/tale-100-findings/commerce-proof/vitest.config.ts /Users/yannick/.codex/notes/tale-100-findings/commerce-proof/boundaries.probe.test.tsx --maxWorkers 2 --reporter verbose --silent=false

HTTP readback command: python3 /Users/yannick/.codex/notes/tale-100-findings/commerce-proof/boundary-api-probe.py. Component probes passed 3/3; HTTP assertions passed. Scratch tests remain outside the checkout.

Proof boundary: Actual ContactsTable, DataTable, row menu, row selection, bulk confirmation and deletion callback executed in jsdom. An independently created Commerce audit Salesforce fixture was deleted through the local API and read back; only that owned row was trashed. No production testing. This is a UI eligibility bypass, not a claim that the documented machine API may never delete synced records.

Source:

Deduplication: Cached titles and all-state searches bulk delete synced contacts and bulk permission contacts found no equivalent report. Closed #1047/#1028 requested bulk actions; this is their missing eligibility constraint.

Acceptance: Cover the triggering boundary with a regression test, enforce the expected behavior, and retain the passing control.

Parent verification: independently reran the observation/control proof successfully; retained output: commerce-proof/parent-boundaries.log. Live all-state feature searches and related historical reports were reviewed before filing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugservice: platform

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions