From 2fd84eac7d58a2d0d817fffa5c5152a61750b7ed Mon Sep 17 00:00:00 2001 From: Olivier Date: Wed, 26 Aug 2026 17:29:13 +0000 Subject: [PATCH] Use DELETE to delete profile fields, not PUT with null MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Null is not interoperable as an allowable field value: > Servers MAY reject null values. — https://spec.matrix.org/v1.19/client-server-api/#put_matrixclientv3profileuseridkeyname --- tests/msc4429/msc4429_test.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/msc4429/msc4429_test.go b/tests/msc4429/msc4429_test.go index 8cd318ce1..eacf1467b 100644 --- a/tests/msc4429/msc4429_test.go +++ b/tests/msc4429/msc4429_test.go @@ -172,7 +172,7 @@ func TestMSC4429ProfileUpdates(t *testing.T) { ) // Bob clears their status. - mustSetProfileField(t, bob, "m.status", nil) + mustDeleteProfileField(t, bob, "m.status") // Wait until alice sees the status be set to `null` (nil). alice.MustSyncUntil( @@ -276,6 +276,12 @@ func mustSetProfileField(t *testing.T, user *client.CSAPI, field string, value i ) } +// mustDeleteProfileField clears the given profile field ID on the given user's profile. +func mustDeleteProfileField(t *testing.T, user *client.CSAPI, field string) { + t.Helper() + user.MustDo(t, "DELETE", []string{"_matrix", "client", "v3", "profile", user.UserID, field}) +} + // getProfileUpdate extracts the given profile updates for a given user by field // ID from a legacy `/sync` response. func getProfileUpdate(res gjson.Result, userID, field string) (gjson.Result, bool) {