Skip to content
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

Closed
wants to merge 2 commits into from

Conversation

sandhose
Copy link
Member

@sandhose sandhose commented Feb 15, 2023

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

@sandhose sandhose requested review from a team and kegsay as code owners February 15, 2023 17:21
@sandhose sandhose force-pushed the quenting/txnid-scope branch 3 times, most recently from d776cd1 to 56838e8 Compare February 16, 2023 13:37
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.
Copy link
Member

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.

Copy link
Member

@hughns hughns Feb 23, 2023

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:

  1. Opened a specific issue to track the bug in Synapse
  2. Added further comments to clarify what is going on here

@hughns
Copy link
Member

hughns commented Feb 23, 2023

I've added a further test that checks the idempotency of requests.

Copy link
Member

@clokep clokep left a 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.

@clokep clokep removed request for a team and kegsay February 23, 2023 18:00
@hughns
Copy link
Member

hughns commented Feb 23, 2023

@clokep Okay, I've removed the test entirely in f829a94 and we can add it back in another PR later on 👍

@clokep clokep requested a review from a team February 23, 2023 18:59
// 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)
Copy link
Member

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

@hughns
Copy link
Member

hughns commented Mar 4, 2023

As per discussion in #synapse-dev:matrix.org I've pulled the definitely good tests out in to #622 for separate review.

@erikjohnston
Copy link
Member

Sorry, is this still requiring review?

@hughns hughns force-pushed the quenting/txnid-scope branch 3 times, most recently from 18a8c81 to 3049413 Compare April 18, 2023 15:26
@hughns
Copy link
Member

hughns commented Apr 18, 2023

@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?

@hughns
Copy link
Member

hughns commented May 26, 2023

This PR should be closed as MSC3970 has been accepted and so new tests are in #637

@sandhose sandhose closed this May 26, 2023
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.

4 participants