feat: add MSC4306 thread subscription API and push condition#5311
Draft
nathanael-h wants to merge 1 commit intomatrix-org:developfrom
Draft
feat: add MSC4306 thread subscription API and push condition#5311nathanael-h wants to merge 1 commit intomatrix-org:developfrom
nathanael-h wants to merge 1 commit intomatrix-org:developfrom
Conversation
Add client-side support for MSC4306 (Thread Subscriptions): - `subscribeToThread()`, `unsubscribeFromThread()`, `getThreadSubscription()` methods on `MatrixClient` using the unstable prefix `/_matrix/client/unstable/io.element.msc4306`. - In-memory subscription cache (`getCachedThreadSubscription()`) for synchronous lookups from `PushProcessor`. - New `thread_subscription` / `io.element.msc4306.thread_subscription` condition kind in `PushProcessor.eventFulfillsCondition()`, backed by the cache (fails closed when state is unknown). Ref: matrix-org/matrix-spec-proposals#4306
Draft
7 tasks
nathanael-h
added a commit
to nathanael-h/element-web
that referenced
this pull request
May 4, 2026
- Add ThreadSubscriptionButton with Follow/Following text and bell icon,
placed in the thread view header.
- Subscribe-on-send: automatically PUT subscription when user sends a
message in a thread (MSC4306 Behaviour A).
- Subscribe-on-mention: automatically PUT subscription with
`{automatic: "$eventId"}` when an incoming thread event triggers a
notify push action, skipping ignored/banned senders (MSC4306 Behaviour B).
- Session-level cache to avoid duplicate PUT requests.
- Uses new matrix-js-sdk MSC4306 methods (subscribeToThread, etc.).
Depends on: matrix-org/matrix-js-sdk#5311
Ref: matrix-org/matrix-spec-proposals#4306
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
subscribeToThread(),unsubscribeFromThread(),getThreadSubscription()methods onMatrixClientusing the/_matrix/client/unstable/io.element.msc4306prefix.getCachedThreadSubscription()) for synchronous lookups fromPushProcessor.PushProcessorto evaluate the newthread_subscription/io.element.msc4306.thread_subscriptionpush-rule condition kind, backed by the cache (fails closed when subscription state is unknown).Ref: matrix-org/matrix-spec-proposals#4306
Test plan
pnpm build)pnpm test -- src/pushprocessor)thread_subscriptioncondition (subscribed, unsubscribed, unknown cache states)subscribeToThread/unsubscribeFromThreadproduce correct requests