Skip to content

[Bug] Race condition in explorer icon updates causes partial refresh on batch operations #20

@soler1212

Description

@soler1212

Description

When updating status on multiple files via batch operations (context menu), some file explorer icons update correctly while others remain with old status icons.

Current Behavior

  • Select multiple files → right-click → change status
  • Some icons update to new status ✅
  • Some icons keep old status ❌
  • Inconsistent across files in same batch

Expected Behavior

All selected files should update their explorer icons consistently after batch status change.

Root Cause

Race condition between:

  1. Individual note-status:status-changed events fired per file
  2. Debounced update queue in ExplorerIntegration
  3. Direct icon updates in handleStatusChanged()

Multiple update mechanisms conflict, causing partial updates.

Technical Solution

  • Replace individual events with single note-status:batch-status-changed event
  • Add updateBatchFileExplorerIcons() method to handle batch updates
  • Clear update queue before batch processing to avoid conflicts

Files Affected

  • services/status-service.ts
  • main.ts
  • integrations/explorer/explorer-integration.ts

Priority

Medium - Affects UX but workaround exists (manual refresh)

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions