Skip to content

Conversation

@poljar
Copy link
Contributor

@poljar poljar commented Dec 3, 2025

This is not supported by Ruma. The join_rule field, despite being defined as a pure string, can have associated data to it based on the join rule variant.

This means that custom and unknown enum variants might lose data when reserializing.

Let's just skip the serialization of custom join rules in the RoomInfo, the concrete value is still available in the state store, it's just not kept at hand in the RoomInfo.

This closes #5883 and #2949.

I have checked, the other enums that can encounter custom variants, i.e. HistoryVisibilty are not problematic as they have a working Serialize implementation for all variants, even the custom one.

  • Public API changes documented in changelogs (optional)

@poljar poljar requested a review from a team as a code owner December 3, 2025 12:14
@poljar poljar requested review from Hywan and removed request for a team December 3, 2025 12:14
This is not supported by Ruma. The join_rule field, despite being
defined as a pure string, can have associated data to it based on the
join rule variant.

This means that custom and unknown enum variants might lose data when
reserializing.

Let's just skip the serialization of custom join rules in the RoomInfo,
the concrete value is still available in the state store, it's just not
kept at hand in the RoomInfo.
@poljar poljar force-pushed the poljar/skip-custom-join-rule-serialization branch from aef9789 to ba1560d Compare December 3, 2025 12:21
@codspeed-hq
Copy link

codspeed-hq bot commented Dec 3, 2025

CodSpeed Performance Report

Merging #5924 will not alter performance

Comparing poljar/skip-custom-join-rule-serialization (32d51a5) with main (2412403)

Summary

✅ 50 untouched

@codecov
Copy link

codecov bot commented Dec 3, 2025

Codecov Report

❌ Patch coverage is 66.66667% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.65%. Comparing base (b4d7881) to head (32d51a5).
⚠️ Report is 20 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
crates/matrix-sdk-base/src/room/room_info.rs 66.66% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5924   +/-   ##
=======================================
  Coverage   88.65%   88.65%           
=======================================
  Files         363      363           
  Lines      104739   104739           
  Branches   104739   104739           
=======================================
+ Hits        92852    92861    +9     
+ Misses       7533     7522   -11     
- Partials     4354     4356    +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@Hywan Hywan left a comment

Choose a reason for hiding this comment

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

Fantastic, thanks for finding the true reason of this bug.

Co-authored-by: Ivan Enderlin <[email protected]>
Signed-off-by: Damir Jelić <[email protected]>
@poljar poljar merged commit 4ea0418 into main Dec 3, 2025
53 checks passed
@poljar poljar deleted the poljar/skip-custom-join-rule-serialization branch December 3, 2025 15:55
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.

SyncService becomes offline if it fails processing the sync response

3 participants