Skip to content

fix(bulk-edit): await bulkUpdate dispatch before closing flyout#41

Merged
fathiraz merged 1 commit into
feat/bulk-actions-flyoutsfrom
cursor/bulk-edit-dispatch-failures-78c2
Jun 1, 2026
Merged

fix(bulk-edit): await bulkUpdate dispatch before closing flyout#41
fathiraz merged 1 commit into
feat/bulk-actions-flyoutsfrom
cursor/bulk-edit-dispatch-failures-78c2

Conversation

@fathiraz
Copy link
Copy Markdown
Owner

@fathiraz fathiraz commented Jun 1, 2026

Summary

Addresses PR #38 review: the edit-fields flyout no longer pins Recent or closes after a failed bulkUpdate dispatch.

Changes

  • Background: bulkUpdate returns { ok: true } immediately after accepting work, or { ok: false, reason: 'concurrent' } when the bulk slot is full. Long-running queue work runs in runBulkUpdate without blocking the message reply.
  • Flyout: submitBulkFieldUpdate awaits dispatch, checks the queue preflight (getActiveCount() >= 3), and shows a warning Flash on failure. Success path only then calls onAppliedField and onClose.
  • Tests: Dispatch unit tests for helpers and handler registration.

Verification

pnpm test && pnpm typecheck && pnpm build:chrome && pnpm build:firefox && pnpm build:edge

All passed locally.

Open in Web Open in Cursor 

Summary by cubic

Stops the bulk edit flyout from closing when a bulk update can’t start. The flyout now waits for the bulkUpdate dispatch and shows a warning if the queue is full or messaging fails.

  • Bug Fixes

    • Apply waits for bulkUpdate to accept; on reject, shows a warning Flash and keeps the flyout open.
    • Preflight check blocks when 3 bulk processes are active (queueStore.getActiveCount()); disables Apply while sending to avoid duplicates.
  • Refactors

    • bulkUpdate now returns an immediate dispatch result ({ ok: true } | { ok: false, reason: 'concurrent' }) and runs work in runBulkUpdate with acquire/release.
    • Updated message schema to return BulkUpdateDispatchResult; added tests for dispatch behavior and flyout submission.

Written for commit 8f89fbd. Summary will update on new commits.

Review in cubic

Return a fast accept/reject from the bulkUpdate handler so the edit
flyout can surface queue-full and messaging failures without pinning
Recent or dismissing the picker.
@fathiraz fathiraz marked this pull request as ready for review June 1, 2026 12:59
Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor auto review

No actionable issues found on changed lines.

No actionable issues found.

Generated automatically when this PR was submitted using Cursor CLI with --model auto.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 7 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="src/background/bulk-update.ts">

<violation number="1" location="src/background/bulk-update.ts:57">
P1: Don’t broadcast `Done!` from the error path; it hides bulk-update failures as successes.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

if (isBulkFull()) {
console.warn('[rgp:bg] max concurrent bulk updates reached, rejecting')
try {
await broadcastQueue(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: Don’t broadcast Done! from the error path; it hides bulk-update failures as successes.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/background/bulk-update.ts, line 57:

<comment>Don’t broadcast `Done!` from the error path; it hides bulk-update failures as successes.</comment>

<file context>
@@ -24,265 +25,291 @@ import { broadcastQueue } from '@/background/rest-helpers'
-    if (isBulkFull()) {
-      console.warn('[rgp:bg] max concurrent bulk updates reached, rejecting')
+  try {
+    await broadcastQueue(
+      {
+        total: data.itemIds.length,
</file context>

@fathiraz fathiraz merged commit 7012203 into feat/bulk-actions-flyouts Jun 1, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants