fix: update analytics profile room IDs on change, set via parameter in analytics room knock request (#4949)

This commit is contained in:
ggurdin 2025-12-29 10:16:07 -05:00 committed by GitHub
parent d8caf8e481
commit 61fa30dba5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 2 deletions

View file

@ -289,7 +289,14 @@ class SpaceAnalyticsState extends State<SpaceAnalytics> {
try {
final roomId = _analyticsRoomIdOfUser(user);
if (roomId == null) return;
await Matrix.of(context).client.knockRoom(roomId);
await Matrix.of(context).client.knockRoom(
roomId,
via: room?.spaceChildren
.firstWhereOrNull(
(child) => child.roomId == roomId,
)
?.via,
);
status = RequestStatus.requested;
} catch (e) {
status = RequestStatus.unavailable;

View file

@ -108,7 +108,7 @@ class AnalyticsProfileModel {
}
final currentRoomId = analyticsRoomIdByLanguage(language);
if (currentRoomId == null) {
if (currentRoomId != analyticsRoomId) {
languageAnalytics![language]!.analyticsRoomId = analyticsRoomId;
}
languageAnalytics![language]!.level = level;