Skip to content

Conversation

@dahlia
Copy link
Member

@dahlia dahlia commented Jun 9, 2025

Summary

Adds optional MessageQueue.nativeRetrial property to indicate whether the message queue backend provides native retry mechanisms. When true, Fedify skips its own retry logic and relies on the backend to handle retries.

Changes

  • DenoKvMessageQueue.nativeRetrial is true
  • WorkersMessageQueue.nativeRetrial is true
  • InProcessMessageQueue.nativeRetrial is false
  • ParallelMessageQueue.nativeRetrial inherits from wrapped queue

Test plan

  • Unit tests for all queue implementations
  • Integration tests for middleware behavior
  • All existing tests pass

Fixes #250

Implements MessageQueue.nativeRetrial property to indicate whether
the message queue backend provides native retry mechanisms. When true,
Fedify skips its own retry logic and relies on the backend to handle
retries, avoiding duplicate retry mechanisms.

- DenoKvMessageQueue.nativeRetrial is true (Deno KV provides automatic retry)
- WorkersMessageQueue.nativeRetrial is true (Cloudflare Queues provide automatic
  retry)
- InProcessMessageQueue.nativeRetrial is false (no native retry)
- ParallelMessageQueue.nativeRetrial inherits from wrapped queue

Fixes fedify-dev#250

Co-Authored-By: Claude <[email protected]>
@dahlia dahlia added type/feature Requests for new features component/federation Federation object related labels Jun 9, 2025
@dahlia dahlia added this to the Fedify 1.7 milestone Jun 9, 2025
@github-actions github-actions bot added component/mq Message queue related difficulty/intermediate Intermediate level priority/medium Medium priority issues type/enhancement Improvements to existing features labels Jun 9, 2025
@dahlia dahlia temporarily deployed to github-pages June 9, 2025 10:52 — with Image GitHub Actions Inactive
@github-actions
Copy link
Contributor

github-actions bot commented Jun 9, 2025

The docs for this pull request have been published:

https://e8dd0d07.fedify.pages.dev

@dahlia dahlia self-assigned this Jun 9, 2025
Updates documentation across all relevant manual sections to explain the new
MessageQueue.nativeRetrial property and its impact on retry behavior:

- Add comprehensive "Native retry mechanisms" section to mq.md
- Update federation.md to note when retry policies are ignored
- Update send.md and inbox.md to explain native retry behavior
- Document which implementations currently support native retry
- Clarify benefits and usage of native retry mechanisms

The documentation now clearly explains when Fedify's retry logic is bypassed
in favor of backend-native retry mechanisms for better efficiency and
reliability.

Co-Authored-By: Claude <[email protected]>
@github-actions
Copy link
Contributor

github-actions bot commented Jun 9, 2025

The latest push to this pull request has been published to JSR and npm as a pre-release:

@dahlia dahlia temporarily deployed to github-pages June 9, 2025 13:08 — with Image GitHub Actions Inactive
@dahlia dahlia marked this pull request as ready for review June 9, 2025 13:39
@dahlia dahlia requested a review from Copilot June 9, 2025 13:39
@dahlia dahlia changed the title MessageQueue.nativeRetrial property MessageQueue.nativeRetrial property Jun 9, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Adds an optional MessageQueue.nativeRetrial flag so Fedify can defer retry logic to backends that support it, and updates code, tests, and docs accordingly.

  • Introduce nativeRetrial on all queue implementations and in the interface
  • Update middleware to skip Fedify retries when nativeRetrial is true
  • Extend tests and documentation to cover and describe the new property

Reviewed Changes

Copilot reviewed 12 out of 13 changed files in this pull request and generated no comments.

Show a summary per file
File Description
fedify/x/denokv.ts Set DenoKvMessageQueue.nativeRetrial = true
fedify/x/cfworkers.ts Set WorkersMessageQueue.nativeRetrial = true
fedify/federation/mq.ts Add nativeRetrial to MessageQueue interface, InProcessMessageQueue, and ParallelMessageQueue
fedify/federation/middleware.ts Skip retry logic in outbox/inbox if nativeRetrial is enabled
fedify/federation/mq.test.ts Add unit tests for nativeRetrial on each queue and inheritance via ParallelMessageQueue
fedify/federation/middleware.test.ts Add integration tests for processQueuedTask with and without nativeRetrial
docs/package.json Bump @fedify/fedify dependency to 1.7.0-pr.251.885
docs/manual/send.md Update retry description to mention nativeRetrial
docs/manual/mq.md Document native retry support and list implementations
docs/manual/inbox.md Update inbox retry docs with nativeRetrial behavior
docs/manual/federation.md Note that retry policies are ignored when nativeRetrial is true
CHANGES.md Add changelog entry for the nativeRetrial feature
Files not reviewed (1)
  • docs/pnpm-lock.yaml: Language not supported

@dahlia dahlia merged commit 013dabb into fedify-dev:main Jun 10, 2025
41 of 47 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/federation Federation object related component/mq Message queue related difficulty/intermediate Intermediate level priority/medium Medium priority issues type/enhancement Improvements to existing features type/feature Requests for new features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add automatic retry capability flag to MessageQueue interface

1 participant