You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: ARCHITECTURE.md
+13-4Lines changed: 13 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -159,10 +159,16 @@ Flutter App Go AS Synapse
159
159
| | |
160
160
|-- POST /guilds ->| |
161
161
| |-- createRoom(space) --> |
162
+
| |-- createRoom(general, voice) with power_level_content_override --> |
162
163
| |<- room_id ---------|
163
164
|<- guild data ----| |
164
165
```
165
166
167
+
**Child Room Power Levels:** The `general` and `voice` child rooms are created with a `power_level_content_override` that sets `users_default: 100` and `state_default: 0`. This ensures:
168
+
- Every guild member (PL 0 by default after joining via invite) can send messages, set `m.call.member` state for voice, and create new channels.
169
+
-`m.room.encrypted: 100` prevents accidental E2EE enablement in guild rooms.
170
+
- The guild owner's Matrix user ID is set to PL 100 explicitly.
171
+
166
172
---
167
173
168
174
## 4. Development Workflow
@@ -223,7 +229,7 @@ cd app; dart analyze lib
223
229
224
230
### Unit & Widget Tests
225
231
226
-
290 tests covering all providers, models, and key widgets.
232
+
296 tests covering all providers, models, and key widgets (including 4 new chat-provider tests for message-history-on-re-login and 2 multi-user voice integration tests).
@@ -356,6 +364,7 @@ flutter test integration_test/visual_test.dart -d windows
356
364
### Presence
357
365
358
366
-**Source:** Native Matrix presence events via `client.onPresenceChanged.stream`.
367
+
-**Eager Initialization:**`presenceProvider` is watched in `ConcordApp.build()` (alongside `autoStatusProvider`) so the subscription starts before the first Matrix sync completes. This prevents presence events arriving during the initial sync from being missed due to lazy Riverpod provider initialization.
-[x]**Visual Integration Tests:** 34 end-to-end UI tests across 9 groups (E2EE, Server Selection, Registration, Login, Guilds, Invites, Channels, Messaging, Settings)
16
-
-[x]**API Integration Tests:**28 Matrix SDK + Go AS endpoint tests across 6 groups
16
+
-[x]**API Integration Tests:**29 Matrix SDK + Go AS endpoint tests across 6 groups (messaging tests use CS API directly for reliability)
17
17
-[x]**In-App Logging:** LoggerService for structured app-level logging
18
18
-[x]**MatrixSdkDatabase Migration:** Migrated from deprecated HiveCollectionsDatabase to SQLite-backed MatrixSdkDatabase with automatic legacy data migration
@@ -41,14 +41,16 @@ Architecture: **Matrix-native** (Synapse homeserver + Go Application Service + F
41
41
-[x]**Leave Guild:**`room.leave()` via Matrix SDK
42
42
-[x]**Invite System:** AS generates 6-char codes; `POST /invites/:code` joins space + all child rooms
43
43
-[x]**Message Persistence:**`history_visibility: shared` on all rooms (no E2EE on guild rooms) so messages survive logout/login
44
+
-[x]**Message History on Re-login:**`requestHistory(historyCount: 50)` called automatically when local SQLite cache is empty after re-login — general channel messages are never lost
44
45
-[x]**Owner Detection:** Extracted from `m.room.create` state event `senderId`
46
+
-[x]**Child Room Power Levels:** All guild child rooms (general, voice) created with `users_default: 100` and `state_default: 0` so every member can send messages, set `m.call.member` state, and create new channels without needing admin rights
45
47
46
48
### Channels (Matrix Rooms)
47
49
-[x]**Channel List:** Text and voice rooms as space children
48
50
-[x]**Create Channel:** Matrix room creation + `m.space.child` state event; default power levels allow all members to create channels
49
51
-[x]**Delete Channel:**`room.leave()` via Matrix SDK
50
52
-[x]**Channel Types:** Text and voice differentiation
-[x]**Channels Visible After Join:** Invite-join flow auto-joins child rooms; channels appear immediately for newly joined members (power levels allow all members to read and interact)
52
54
53
55
### Chat (Matrix Timeline)
54
56
-[x]**Real-time Messaging:** Matrix sync / timeline stream for instant delivery
@@ -68,6 +70,7 @@ Architecture: **Matrix-native** (Synapse homeserver + Go Application Service + F
-[x]**Eager Initialization:**`presenceProvider` is eagerly started in `ConcordApp.build()` alongside `autoStatusProvider` so no presence events from the initial Matrix sync are missed
-[x]**Auto-Away (Mobile):** 30-second background grace period
73
76
-[x]**Status Indicator:** Always visible in user controls
@@ -78,6 +81,7 @@ Architecture: **Matrix-native** (Synapse homeserver + Go Application Service + F
78
81
-[x]**Connect/Disconnect:** Join/leave voice rooms via LiveKit + Matrix state events
79
82
-[x]**m.call.member State:** Voice membership tracked via Matrix state events with `expires_ts`
80
83
-[x]**VoiceStateStoreNotifier:** Parses `m.call.member` from all rooms on each sync
84
+
-[x]**Multi-User Voice Visibility:** Both users' `m.call.member` state events are correctly visible to one another — tested via integration tests (sequential and simultaneous join scenarios)
81
85
-[x]**Mute/Deafen Toggles:** Local track control + `broadcastVoiceStateChange()` state update
82
86
-[x]**Single-Channel Enforcement:** Client-side invariant via `VoiceController` + `_broadcastLeave()` for old channel on switch
83
87
-[x]**Voice Cleanup on Logout:**`leaveChannel()` called before `client.logout()` to clear `m.call.member` state
0 commit comments