Read ephemeral events from the stable transaction key#84
Merged
AndrewFerr merged 3 commits intoJul 2, 2026
Conversation
Homeservers deliver ephemeral events (typing, receipts, presence) to appservices under the stable `ephemeral` key in the transaction body per the Matrix spec, but onTransaction only read the unstable `de.sorunome.msc2409.ephemeral` key. Modern homeservers (e.g. Synapse, and Beeper's hungryserv) send the stable key, so ephemeral events were silently dropped. Read the stable key with a fallback to the unstable one, and add tests.
AndrewFerr
requested changes
Jul 2, 2026
AndrewFerr
left a comment
Member
There was a problem hiding this comment.
This is indeed a helpful fix. Thank you for contributing it!
There is just one small nitpick change I'll request, and one optional suggestion.
Also, don't forget to sign off this PR. The easiest way is to add a Signed-off-by line to the top comment of the PR.
| const ephemeral = req.body["de.sorunome.msc2409.ephemeral"] || []; | ||
| // Ephemeral events are delivered under the stable `ephemeral` key by | ||
| // spec-compliant homeservers; fall back to the unstable MSC2409 key for | ||
| // older ones. See https://spec.matrix.org/v1.11/application-service-api/#put_matrixappv1transactionstxnid |
Member
There was a problem hiding this comment.
The ephemeral key was added in v1.13 of the spec, so the link should point to at least that version.
Suggested change
| // older ones. See https://spec.matrix.org/v1.11/application-service-api/#put_matrixappv1transactionstxnid | |
| // older ones. See https://spec.matrix.org/v1.13/application-service-api/#put_matrixappv1transactionstxnid |
Signed-off-by: Lê Quốc Bình <lequocbinh04@users.noreply.github.com>
Contributor
Author
|
Thanks for the review! Addressed both points:
Signed-off-by: Lê Quốc Bình lequocbinh04@users.noreply.github.com |
AndrewFerr
approved these changes
Jul 2, 2026
Member
|
Ah, the Signoff job is failing because it's still on an older version that runs into false positives. That will be fixed by #81. Merging this PR in the meantime. Thanks again! |
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.
Description
Ephemeral events (typing, receipts, presence) are delivered to application services under the stable
ephemeralkey in the transaction body, per the Matrix application service spec (the stabilisation of MSC2409). HoweverAppService.onTransactiononly reads the legacy unstable keyde.sorunome.msc2409.ephemeral.As a result, ephemeral events from spec-compliant homeservers are silently dropped —
onEphemeralEvent/ theephemeralemitter never fire. I hit this building a bridge against Beeper's hungryserv (which sends the stable key): read receipts and typing never reached the bridge. Synapse also sends the stable key.Change
Read
req.body.ephemeralfirst, falling back toreq.body["de.sorunome.msc2409.ephemeral"]for older homeservers. Adds tests covering both keys and the precedence.npm run build, lint, andnpm testall pass.Signed-off-by: Lê Quốc Bình lequocbinh04@users.noreply.github.com