Skip to content

List bulk Delete: when records are refused the toast says only "0 deleted, 4 failed"; the server's reason for each record, which a single delete shows, is dropped #37758

Description

@objectstack-fleet

repo:hotcrm#2 · sunhaolin · session_local1adc6fb3954245ba8940a3719cdaea98

Filing gate: ① product defect with a reproduction and a named location. Source: fleet (found in a maintainer-ordered local UI test pass of the HotCRM app, 2026-11-27; filed through the pm-dispatch relay on the maintainer's instruction).
Grading: area:ux · Bug · p2 (triage grades) · severity: Impeded · reach: every list with the built-in bulk Delete, whenever a selected record is refused (restrict, lock, permission) · evidence: measured on the released 18.6.0 packages, zh-CN console; the code path was read on main on 2026-11-27 and is unchanged

维护者速读

  • 做什么:列表批量删除有记录被拒绝时,提示里要说明原因(服务端已经给了可读的中文原因)。
  • 谁受益:所有用列表批量删除的用户。
  • 不做会怎样:只看到「成功 0 条,失败 4 条」,不知道为什么失败、该先做什么;同一条记录单独删除时却能看到完整原因。
  • 需要你做的:无,分诊定级即可。

What

The built-in bulk Delete on a list deletes the selected records one call each and reports one summary toast. When some or all calls are refused, the toast carries only the two counts. The reason each refusal carries is discarded, although it is localized and tells the user what to do next.

Measured (HotCRM, events list, 4 events that each still have attendee rows; the attendee's master-detail to the event declares deleteBehavior: 'restrict'):

path what the user sees
select 4 → Delete → confirm toast 「成功 0 条,失败 4 条」, nothing else
row menu → Delete on one of the same records toast 「删除 活动 失败」 with the description 「该活动正被 1 条活动参与者记录通过「活动」引用,请先删除或改派这些记录。」

Network for the bulk path: four DELETE /api/v1/data/crm_event/{id} calls, each 409 with a body of the shape

{"error":"该活动正被 3 条活动参与者记录通过「活动」引用,请先删除或改派这些记录。","code":"DELETE_RESTRICTED","dependentObject":"crm_event_attendee","dependentCount":3,"object":"crm_event"}

So the server answers every record with a clear reason and the bulk summary throws it away.

Where

ui/packages/core/src/actions/recordDelete.ts, the bulk branch of run (main, about lines 354 to 383): Promise.allSettled over the deletes, then failed = results.filter(r => r.status === 'rejected').length and toast.error(t('objectActions.bulkDeletePartial', { succeeded, failed })). The rejected results' reason is never read. The single-record branch below it passes (err as Error).message as the toast description.

Reproduction

  1. Take an object whose child declares deleteBehavior: 'restrict' on its lookup, with two or more parent records that have children.
  2. On the parent's list select them, choose Delete in the bulk bar and confirm.
  3. Result: 「成功 0 条,失败 N 条」 with no reason. Delete one of them from its row menu: the reason is shown.

Acceptance

Also seen, not investigated (triage may split it)

A list whose view declares its own bulk action with operation: 'delete' (HotCRM accounts and opportunities, bulkActionDefs) deleted 4 and 6 records with no success toast at all within 3 seconds; the rows left the list and that was the only feedback. The built-in bulk Delete says 「已删除 N 条 … 记录」 in the same situation. What that declared path shows when a record is refused was not measured.

Dedupe (open and closed): bulk delete 12 hits, nearest #36855 (closed, approvals inbox bulk approve lists failed rows without a reason) and #36851 (closed, a refused delete from a related list was silent), neither covers the list bulk Delete summary; DELETE_RESTRICTED 12 closed hits, nearest #32648 (organization delete), unrelated; bulk delete toast failure, failed toast reason 0 hits.
Batch-of: cleanup of the local UI deep test pass 2026-11-26/27, 2 cards (both in objectstack), after the 14 cards of the pass itself.
Blocked-by: none.

Activity

  1. added
    bug
    priority:p2
    on Nov 27, 2026
  2. objectstack-fleet commented on Nov 27, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Triage: lands in area:ux · domain:ui · Bug · priority:p2 · pm:queue · size S; rationale: when records are refused, the list bulk Delete toast says only "0 deleted, 4 failed", and the server's reasons are dropped. Measured, user-facing, common path: p2 as filed.

  3. added
    domain:ui
    pm:queue
    on Nov 27, 2026
  4. objectstack-fleet commented on Nov 27, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#2 · os-sales · session_01L6bhgUuauSMJu1nVSQRQri

    Claim: PM loop · 2026-11-27T04:1xZ
    Session: session_01L6bhgV6i8jfWwSXjpWJrjA
    Thread session: session_01L6bhgUuauSMJu1nVSQRQri
    Account: os-sales
    Branch: claude/project-thread-th9squ (the area's one branch, restarted from main)
    Domain: domain:ui
    Seat: repo:objectstack#2
    Area: s2-ux-L (slot given by the seat at 04:05Z)
    Scope: the built-in list bulk Delete summary. The "also seen" declared operation: 'delete' bulk action is not in scope (not measured); the related list's inline bulk-delete outcome line has the same count-only shape and is named in the PR as a follow-up, not changed here.
    File surface:

    • ui/packages/core/src/actions/recordDelete.ts: the bulk branch reads each rejected result's reason; the summary toast keeps its count title and gains a description that groups refusals sharing a reason (reason and how many records), and names the record for a reason only one record has
    • ui/packages/i18n/src/locales/*.ts and the fallback tables beside bulkDeletePartial (plugin-view ObjectView.tsx, plugin-detail useDetailTranslation.ts) for the new keys
    • ui/packages/core/src/actions/__tests__/recordDelete.test.ts: an all-refused batch and a mixed batch; one changeset
      Container & model: S, mode:thread, model: default — no path-derived mandate, effort: medium
      Clause-②: no
      Metadata-protocol: none
      Skills-docs: none (no skill teaches the bulk delete toast)
      Responsibility: objectui list bulk Delete (recordDelete.run bulk branch counts rejections and drops each reason) | none | every user who bulk-deletes records some of which are refused (restrict, lock, permission); reachable today
      Thread-read: none
      Prior rulings read: none on this card; MCP: delete records by filter in one confirmed call, with refusals grouped by reason, instead of one delete_record per row #30891 and 审批中心批量审批:失败的行只列记录名,不说为什么失败 #36855 as the grouping precedent the card cites
      Premise: holds (static read on origin/main cac93cc: run filters results for rejected and toasts bulkDeletePartial with the two counts only; no reason is read; the single-record branch passes (err as Error).message as the description). A red test on main pins it before the fix.
      Serial constraints cleared: overlap-check before the first push
      L2: not owed by path (no packages/spec/src, no Clause-②, no protocol change); the seat decides at L1
  5. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 27, 2026
  6. objectstack-fleet commented on Nov 27, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA

    Landed · 2026-11-27T06:10Z

    PR #37809 merged at 2026-11-27T05:16Z (298048394e) and closed this card. pm:dispatched is cleared. The review follow-ups are on #37816.

  7. removed
    pm:dispatched
    on Nov 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:uxbugdomain:uipriority:p2

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions