Skip to content

rabbitmq - chore: test cleanup#186

Merged
jaredwray merged 1 commit intomainfrom
rabbitmq---chore-test-cleanup
Apr 23, 2026
Merged

rabbitmq - chore: test cleanup#186
jaredwray merged 1 commit intomainfrom
rabbitmq---chore-test-cleanup

Conversation

@jaredwray
Copy link
Copy Markdown
Owner

@jaredwray jaredwray commented Apr 23, 2026

Please check if the PR fulfills these requirements

  • Followed the Contributing and Code of Conduct guidelines.
  • Tests for the changes have been added (for bug fixes/features) with 100% code coverage.

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
rabbitmq - chore: test cleanup

@jaredwray jaredwray merged commit d4595cf into main Apr 23, 2026
6 checks passed
@jaredwray jaredwray deleted the rabbitmq---chore-test-cleanup branch April 23, 2026 16:47
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a guard to prevent multiple task handlers from acknowledging or rejecting the same AMQP message if it has already been handled. By checking the amqpHandled state within the ack and reject methods, the implementation avoids duplicate side effects such as multiple tasks being sent to the Dead Letter Queue. Additionally, the edge case tests were refactored to use the public dequeue method and now include assertions to verify that messages are only sent to the queue once. I have no feedback to provide.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 15c86b9f91

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

const context: TaskContext = {
ack: async () => {
if (acknowledged || rejected || !this._active) {
if (acknowledged || rejected || !this._active || isAmqpHandled()) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Preserve attempt-count cleanup after AMQP is handled

processTask increments _attemptCounts before handler execution, but with this new isAmqpHandled() early return in ctx.ack, any later handler on the same message will skip cleanup once an earlier handler has already acked/nacked. In multi-handler queues, that leaves a new _attemptCounts entry behind for an already-completed task, causing unbounded map growth over time (and stale retry metadata for that task id). The guard should avoid duplicate AMQP side effects without bypassing local bookkeeping cleanup.

Useful? React with 👍 / 👎.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (ccf9629) to head (15c86b9).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #186   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           10        10           
  Lines         1264      1265    +1     
  Branches       230       230           
=========================================
+ Hits          1264      1265    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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