Skip to content

Preserve queue names during storage recovery#1418

Open
abishekgiri wants to merge 2 commits intoiii-hq:mainfrom
abishekgiri:queue-recovery-name-parsing
Open

Preserve queue names during storage recovery#1418
abishekgiri wants to merge 2 commits intoiii-hq:mainfrom
abishekgiri:queue-recovery-name-parsing

Conversation

@abishekgiri
Copy link
Copy Markdown
Contributor

@abishekgiri abishekgiri commented Apr 7, 2026

Summary

  • preserve queue names when rebuilding persisted file-based queues
  • parse stored job keys from the right so queue names containing : or :jobs: are not truncated
  • add a regression test covering a queue name like billing:jobs:v2

Testing

  • cargo test -p iii test_rebuild_from_storage_preserves_queue_names_with_colons -- --nocapture

Summary by CodeRabbit

  • Bug Fixes

    • Fixed handling of queue names containing special characters (colons) during state recovery from persistent storage. Queue names are now correctly preserved and jobs can be retrieved after system restart.
  • Tests

    • Added test coverage for queue names with special characters in persistence scenarios.

@vercel
Copy link
Copy Markdown
Contributor

vercel bot commented Apr 7, 2026

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

A member of the Team first needs to authorize it.

@abishekgiri
Copy link
Copy Markdown
Contributor Author

Updated the file-based queue recovery path so persisted job keys keep the full queue name, even when the queue name contains or . This also adds a regression test that rebuilds a delayed job from after persistence.

@abishekgiri
Copy link
Copy Markdown
Contributor Author

Updated the file-based queue recovery path so persisted job keys keep the full queue name, even when the queue name contains colons or the literal segment :jobs:. This also adds a regression test that rebuilds a delayed job from billing:jobs:v2 after persistence.

@abishekgiri abishekgiri marked this pull request as ready for review April 7, 2026 00:58
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 10, 2026

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: 6d31b4f1-21a9-4db3-96c3-b46bb5a72a55

📥 Commits

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

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

📝 Walkthrough

Walkthrough

A helper function queue_name_from_job_key() was added to extract queue names from storage keys reliably. The rebuild_from_storage method was updated to use this helper instead of brittle fixed-index splitting. A test was added to verify queue names containing colons are preserved during rebuild operations.

Changes

Cohort / File(s) Summary
Queue name parsing logic
engine/src/builtins/queue.rs
Added queue_name_from_job_key() helper using rsplit_once to safely extract queue names from storage keys, replacing fixed-index splitting. Updated rebuild_from_storage to use the new helper. Added async test verifying queue names with colons survive nack/rebuild cycles and retain original job IDs.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 A colon-loving queue needed care,

So helpers were crafted with thought and flair,

Storage keys split just right—no despair,

Names with colons now handled with care! 🥕

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Preserve queue names during storage recovery' directly and clearly summarizes the main change: fixing queue name preservation during file-based storage recovery to handle queue names with colons.

✏️ 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.

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