|
// sytest: Setting state twice is idempotent |
|
t.Run("Setting state twice is idempotent", func(t *testing.T) { |
|
t.Parallel() |
|
|
|
stateEvent := b.Event{ |
|
Type: "a.test.state.type", |
|
StateKey: b.Ptr(""), |
|
Content: map[string]interface{}{ |
|
"a_key": "a_value", |
|
}, |
|
} |
|
|
|
firstID := alice.SendEventSynced(t, roomID, stateEvent) |
|
secondID := alice.SendEventSynced(t, roomID, stateEvent) |
|
|
|
if firstID != secondID { |
|
t.Fatalf("Both Event IDs from supposedly-idempotent state-setting differ, %s != %s", firstID, secondID) |
|
} |
|
}) |
This behaviour is not written anywhere in the specification and is technically incorrect behaviour considering there is no transaction ID for setting state (which removes the idempotency guarantee)
complement/tests/csapi/rooms_state_test.go
Lines 90 to 108 in 1a2baac
This behaviour is not written anywhere in the specification and is technically incorrect behaviour considering there is no transaction ID for setting state (which removes the idempotency guarantee)