-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test the scope of a transaction IDs #613
Conversation
d776cd1
to
56838e8
Compare
tests/csapi/txnid_scope_test.go
Outdated
runtime.SkipIf(t, runtime.Dendrite) | ||
// Dendrite and Conduit don't support refresh tokens yet. | ||
runtime.SkipIf(t, runtime.Dendrite, runtime.Conduit) | ||
// XXX: Synapse's implementation is broken. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the plan to get this working in Synapse? It seems odd to merge a test without one homeserver passing it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree it looks odd and have done two things:
- Opened a specific issue to track the bug in Synapse
- Added further comments to clarify what is going on here
I've added a further test that checks the idempotency of requests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @hughns! I'm just not sure it makes sense to merge this without at least one implementation passing, otherwise we don't know if the tests themselves are correct or not.
tests/csapi/txnid_test.go
Outdated
// TestTxnInEvent checks that the transaction ID is present when getting the event from the /rooms/{roomID}/event/{eventID} endpoint. | ||
func TestTxnInEvent(t *testing.T) { | ||
// Both Synapse and Dendrite implementations are broken | ||
runtime.SkipIf(t, runtime.Synapse) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sandhose this doesn't match the comment above
As per discussion in #synapse-dev:matrix.org I've pulled the definitely good tests out in to #622 for separate review. |
Sorry, is this still requiring review? |
18a8c81
to
3049413
Compare
3049413
to
af92b2f
Compare
@erikjohnston I've given this a severe rebase. It doesn't require review at the moment as the test does not pass for any implementation. Please can it be made draft? |
This adds two tests, which check the current spec behaviour of transaction IDs, which are that they are scoped to a series of access tokens, and not the device ID.
The first test highlight this behaviour, by logging in with refresh token enabled, sending an event, using the refresh token and syncing with the new access token. On the sync, the transaction ID should be there, but currently in Synapse it is not.
This test will fail in Synapse because the behaviour does not match the spec, and it will fail in Dendrite because it does not implement refreshable access tokens. Let me know if I should at it to their respective blacklist?
The second test highlight that the transaction ID is not scoped to the device ID, by logging in twice with the same device ID, sending an event with the first access token, and syncing with the second access token. In that case, the sync should not contain the transaction ID, but I think it's the case in HS implementations which use the device ID to scope the transaction IDs, like Conduit.
Related: matrix-org/matrix-spec#1133, matrix-org/matrix-spec#1236, matrix-org/synapse#13064 and matrix-org/synapse#13083