Skip to content

Keep regular topics separate from function queues in queue console#1446

Open
abishekgiri wants to merge 2 commits into
iii-hq:mainfrom
abishekgiri:console-topic-name-collision
Open

Keep regular topics separate from function queues in queue console#1446
abishekgiri wants to merge 2 commits into
iii-hq:mainfrom
abishekgiri:console-topic-name-collision

Conversation

@abishekgiri

@abishekgiri abishekgiri commented Apr 10, 2026

Copy link
Copy Markdown
Contributor

Summary

  • keep regular queue topics and configured function queues separate when they share the same visible name
  • normalize namespaced function queue rows so the queue console displays them as function_queue entries
  • add regression coverage for same-name regular topics and normalized function queue output

Root Cause

  • console_list_topics merged configured function queues into any existing topic whose visible name matched the queue name
  • that allowed a regular topic like default to be treated as the function queue row, which overwrote its subscriber count and hid the separate function queue entry
  • rows reported by the builtin adapter as __fn_queue::name were also normalized to name without updating broker_type

Impact

  • queue console listings now preserve both rows when a regular topic and a function queue share the same name
  • normalized function queue rows are labeled consistently as function_queue

Testing

  • cargo fmt --all
  • cargo test -p iii console_list_topics_ -- --nocapture

Summary by CodeRabbit

  • Bug Fixes
    • Fixed topic merging logic to correctly distinguish between regular and function-queue topics that share the same name, ensuring both remain visible with their appropriate broker type and subscriber count settings.

@coderabbitai

coderabbitai Bot commented Apr 10, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 8a97af22-00cd-41ad-9e8f-807e188b6796

📥 Commits

Reviewing files that changed from the base of the PR and between 7de5e15 and 1d75234.

📒 Files selected for processing (1)
  • engine/src/workers/queue/queue.rs

📝 Walkthrough

Walkthrough

Updated function-queue topic merging logic in console_list_topics to validate broker_type before matching configured topics. Merge operations now force broker_type to "function_queue" and override subscriber_count from configured concurrency. Added test coverage for scenarios where regular topics coexist with function-queue topics sharing the same visible name.

Changes

Cohort / File(s) Summary
Function-queue topic merging logic
engine/src/workers/queue/queue.rs
Modified console_list_topics merging to require existing entries to have broker_type == "function_queue" before matching configured function-queue topics by name. When merged, broker_type is forced to "function_queue" and subscriber_count is overridden from configured concurrency. Also set broker_type to "function_queue" when stripping __fn_queue:: prefix. Added test case validating that regular topics and function-queue topics with identical visible names remain distinct entries with their respective characteristics.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

Suggested reviewers

  • ytallo

Poem

🐰 Queues now sorted with broker-type care,
Function-queues matched with methods fair,
Merging logic, precise and keen,
Regular topics keep their sheen,
Both coexist in harmony's dance!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately summarizes the main change: preventing regular topics and function queues from being merged into a single console row when they share the same visible name.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@abishekgiri

Copy link
Copy Markdown
Contributor Author

Updated the queue console topic merge logic so regular topics and configured function queues stay as separate rows even when they share the same visible name.

This also normalizes namespaced function queue rows to broker_type function_queue so the console output stays consistent.

Validated with:

  • cargo fmt --all
  • cargo test -p iii console_list_topics_ -- --nocapture

@abishekgiri abishekgiri marked this pull request as ready for review April 10, 2026 05:26
@vercel

vercel Bot commented Apr 10, 2026

Copy link
Copy Markdown
Contributor

@abishekgiri is attempting to deploy a commit to the motia Team on Vercel.

A member of the Team first needs to authorize it.

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.

1 participant