Skip to content

Add tests for MSC4429: Profile Updates for Legacy Sync#849

Open
anoadragon453 wants to merge 13 commits into
mainfrom
anoa/msc4429
Open

Add tests for MSC4429: Profile Updates for Legacy Sync#849
anoadragon453 wants to merge 13 commits into
mainfrom
anoa/msc4429

Conversation

@anoadragon453

@anoadragon453 anoadragon453 commented Mar 12, 2026

Copy link
Copy Markdown
Member

This PR introduces some initial Complement tests for the current draft of MSC4429: Profile Updates for Legacy Sync.

Note: This PR was almost entirely written by OpenAI Codex, but has been reviewed manually. Extra review scrutiny is advised.

Tests are expected to fail until the associated homeserver implementation has been written.

Pull Request Checklist

@anoadragon453 anoadragon453 marked this pull request as ready for review March 18, 2026 15:58
@anoadragon453 anoadragon453 requested review from a team as code owners March 18, 2026 15:59
@MadLittleMods MadLittleMods changed the title Add tests for MSC4429 Add tests for MSC4429: Profile Updates for Legacy Sync Mar 19, 2026
Comment thread tests/msc4429/msc4429_test.go Outdated
Comment thread tests/msc4429/msc4429_test.go
Comment thread tests/msc4429/msc4429_test.go
Comment thread tests/msc4429/msc4429_test.go Outdated
Comment thread tests/msc4429/msc4429_test.go
Comment thread tests/msc4429/msc4429_test.go Outdated
Comment thread tests/msc4429/msc4429_test.go
Comment thread tests/msc4429/msc4429_test.go Outdated
Comment thread tests/msc4429/msc4429_test.go
@anoadragon453

Copy link
Copy Markdown
Member Author

The tests in this PR weren't actually running in CI 🤦 I've fixed that in 4cddfea.

All were expected to succeed (despite all failing), other than the newly added A user leaving the last shared room returns a profile update of null which @jaywink is currently working on. Presumably the Synapse implementation needs adapting to fix the rest of the tests as well.

Still, the tests here should be ready for another round of review.

Comment thread .github/workflows/ci.yaml
repo: element-hq/synapse
tags: synapse_blacklist
packages: ./tests/msc3874 ./tests/msc3902 ./tests/msc4306
packages: ./tests/msc3874 ./tests/msc3902 ./tests/msc4306 ./tests/msc4429

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tests in this PR weren't actually running in CI 🤦 I've fixed that in 4cddfea.

I assume you meant 2b67137 but in any case, we don't really worry about updating this list.

It's already heavily out of sync with the list we run in the Synapse project, element-hq/synapse -> scripts-dev/complement.sh#L272-L289

At this point, I think we just rely on it as a general sanity check that Complement is still working with Synapse.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was planning to update it to match Synapse's list in a separate PR. Seems useful to prevent Complement changes breaking Synapse CI?

Comment thread tests/msc4429/msc4429_test.go

// syncHasProfileUpdatesNull checks whether a sync response contains a null
// profile_updates value for the given user.
func syncHasProfileUpdatesNull(userID string) client.SyncCheckOpt {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like the usage could be replaced by syncHasProfileUpdate(...)

Or at-least this function re-uses syncHasProfileUpdate(...)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mm, it's a bit different as syncHasProfileUpdate expects a field name and an expected value. Where in the null case, the whole profile_updates dict is replaced by a null value.

So you'd probably need to add a fourth argument to syncHasProfileUpdate to indicate that you want to check for null... and that's starting to feel a bit messy to me.

Comment thread tests/msc4429/msc4429_test.go
Comment thread tests/msc4429/msc4429_test.go Outdated
@anoadragon453

anoadragon453 commented Jun 24, 2026

Copy link
Copy Markdown
Member Author

This PR is good to go from my perspective.

I'm now just waiting for the associated Synapse PR to be approved, before we merge it (plus the associated sytest PR) all together.

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.

3 participants