Skip to content

fix(ids): drain queued registry updates during active flush - #691

Merged
rafaelscosta merged 1 commit into
mainfrom
devops/issue-621-registry-queue-drain-20260508
May 8, 2026
Merged

fix(ids): drain queued registry updates during active flush#691
rafaelscosta merged 1 commit into
mainfrom
devops/issue-621-registry-queue-drain-20260508

Conversation

@rafaelscosta

@rafaelscosta rafaelscosta commented May 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • fixes a RegistryUpdater watcher-queue edge case where updates queued during an active batch could remain pending forever
  • treats debounce timers as consumed before flush execution and re-schedules while processing is still active
  • adds a regression test for queued watcher updates during an in-flight batch

Validation

  • NODE_PATH=/Users/rafaelcosta/Projects/AIOX/aiox-core/node_modules /Users/rafaelcosta/Projects/AIOX/aiox-core/node_modules/.bin/jest tests/core/ids/registry-updater.test.js --runInBand --forceExit
    • 40 passed
  • git diff --check
  • NODE_PATH=/Users/rafaelcosta/Projects/AIOX/aiox-core/node_modules /Users/rafaelcosta/Projects/AIOX/aiox-core/node_modules/.bin/eslint . --cache --cache-location .eslintcache
    • 0 errors, 114 baseline warnings
  • NODE_PATH=/Users/rafaelcosta/Projects/AIOX/aiox-core/node_modules /Users/rafaelcosta/Projects/AIOX/aiox-core/node_modules/.bin/tsc --noEmit
  • NODE_PATH=/Users/rafaelcosta/Projects/AIOX/aiox-core/node_modules /Users/rafaelcosta/Projects/AIOX/aiox-core/node_modules/.bin/jest --runInBand --forceExit
    • Test Suites: 12 skipped, 327 passed, 327 of 339 total
    • Tests: 170 skipped, 8294 passed, 8464 total

Refs #621

Summary by CodeRabbit

  • Refactor

    • Centralized debounced update scheduling and error recovery so processing state is cleared on failure, errors are logged consistently, and pending updates are rescheduled.
  • Tests

    • Added tests ensuring updates queued during an active batch are drained correctly and processing state remains consistent.

@vercel

vercel Bot commented May 8, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
aiox-core Ready Ready Preview, Comment May 8, 2026 2:22am

Request Review

@coderabbitai

coderabbitai Bot commented May 8, 2026

Copy link
Copy Markdown

Review Change Stack
No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 1b108e43-6a1a-4e8d-8069-39e74bc9f0b0

📥 Commits

Reviewing files that changed from the base of the PR and between 1694a68 and 90ae69c.

📒 Files selected for processing (3)
  • .aiox-core/core/ids/registry-updater.js
  • .aiox-core/install-manifest.yaml
  • tests/core/ids/registry-updater.test.js
✅ Files skipped from review due to trivial changes (1)
  • .aiox-core/install-manifest.yaml
🚧 Files skipped from review as they are similar to previous changes (2)
  • tests/core/ids/registry-updater.test.js
  • .aiox-core/core/ids/registry-updater.js

Walkthrough

Refactors RegistryUpdater debounce/flush scheduling into a new _scheduleFlush(errorLabel) helper used by _queueUpdate and _flushPending(), centralizing timer management and failure recovery. Adds a Jest test verifying queued updates are processed after an in-progress batch completes. Updates install manifest metadata for the changed file.

Changes

Registry Updater Debounce Error Handling Refactor

Layer / File(s) Summary
Debounce Scheduling Helper
.aiox-core/core/ids/registry-updater.js
New _scheduleFlush(errorLabel) internal helper centralizes debounce timer management, failure logging with context, processing state reset, and conditional rescheduling when pending updates remain.
Flush Scheduling Integration
.aiox-core/core/ids/registry-updater.js
_queueUpdate and deferred path in _flushPending now invoke _scheduleFlush instead of inline timer/defer logic, supplying error labels for tracing.
Concurrent Batch Test
tests/core/ids/registry-updater.test.js
Jest test with fake timers simulates gating the first batch, queues a second update during processing, asserts pendingUpdates > 0, then releases the gate and verifies the queued batch executes and the queue drains.
Manifest Metadata
.aiox-core/install-manifest.yaml
Regenerated generated_at timestamp and updated recorded SHA256 hash and file size for core/ids/registry-updater.js (metadata-only change).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Suggested reviewers

  • Pedrovaleriolopez
  • oalanicolas
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix(ids): drain queued registry updates during active flush' directly and clearly describes the main change: refactoring RegistryUpdater's debounce logic to prevent updates from being stuck when queued during an active flush operation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch devops/issue-621-registry-queue-drain-20260508

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added area: agents Agent system related area: workflows Workflow system related squad mcp type: test Test coverage and quality area: core Core framework (.aios-core/core/) area: installer Installer and setup (packages/installer/) area: synapse SYNAPSE context engine area: cli CLI tools (bin/, packages/aios-pro-cli/) area: pro Pro features (pro/) area: health-check Health check system area: docs Documentation (docs/) area: devops CI/CD, GitHub Actions (.github/) labels May 8, 2026
@github-actions

github-actions Bot commented May 8, 2026

Copy link
Copy Markdown
Contributor

📊 Coverage Report

Coverage report not available

📈 Full coverage report available in Codecov


Generated by PR Automation (Story 6.1)

coderabbitai[bot]
coderabbitai Bot previously approved these changes May 8, 2026
@rafaelscosta
rafaelscosta merged commit df42020 into main May 8, 2026
40 checks passed
@rafaelscosta
rafaelscosta deleted the devops/issue-621-registry-queue-drain-20260508 branch May 8, 2026 02:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: agents Agent system related area: cli CLI tools (bin/, packages/aios-pro-cli/) area: core Core framework (.aios-core/core/) area: devops CI/CD, GitHub Actions (.github/) area: docs Documentation (docs/) area: health-check Health check system area: installer Installer and setup (packages/installer/) area: pro Pro features (pro/) area: synapse SYNAPSE context engine area: workflows Workflow system related mcp squad type: test Test coverage and quality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant