Skip to content

feat: implement MSC4140 delayed events - #555

Draft
neovimbtw wants to merge 1 commit into
matrix-construct:mainfrom
neovimbtw:feat/msc4140-cancellable-delayed-events
Draft

feat: implement MSC4140 delayed events#555
neovimbtw wants to merge 1 commit into
matrix-construct:mainfrom
neovimbtw:feat/msc4140-cancellable-delayed-events

Conversation

@neovimbtw

Copy link
Copy Markdown

What does this PR do?

Closes #178.

This adds persistent support for MSC4140 cancellable delayed events:

  • delayed message and state-event scheduling, including transaction-ID idempotency;
  • send, restart, cancel, get, and list management endpoints;
  • a background scheduler which recovers persisted events after restart and processes them chronologically;
  • configurable per-user and maximum-delay limits, plus capability and /versions advertisement;
  • sender-private handling for delayed-event IDs across client and federation responses; and
  • MatrixRTC and MSC compliance documentation.

The default limits are 100 pending events per user and a maximum delay of 24 hours.

This is a draft because MSC4140 changed after the Ruma revision currently pinned by Tuwunel. The implementation supports both endpoint generations exposed by that revision, but maintainer direction is needed on updating Ruma for the latest authenticated action endpoint. Finalised-record retention/action idempotency and integration with every ordinary event-send policy/rate-limit check also remain to be resolved.

Complement has no existing MSC4140 coverage to update. Focused Rust tests cover request parsing and sender-private unsigned-data filtering.

Validated with:

  • cargo fmt --all -- --check
  • cargo check --workspace --all-targets
  • cargo clippy -p tuwunel_core -p tuwunel_service -p tuwunel_api --all-targets -- -D warnings
  • cargo test -p tuwunel_api delayed_events
  • cargo test -p tuwunel_core remove_transaction_id_strips_all_sender_private_ids

Checklist

  • Code is formatted with nightly cargo fmt and satisfies clippy and rustc lints; any allowed lint is justified by an obvious reason or a comment.
  • Complement compliance changes (new passes or new failures), if any, are noted in the description above.
  • Config option changes were made in src/core/config/mod.rs doc comments and the regenerated tuwunel-example.toml is committed.
  • User-facing changes are reflected in docs/.
  • I agree that my changes may be licensed under the Apache-2.0 licence and my conduct is in line with the Contributor's Covenant and Tuwunel's Code of Conduct.

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.

Delayed events are not supported, and element-call calls will be stuck.

1 participant