Merge branch 'main' into claude/relay-auth-cache-91pa8f

This commit is contained in:
Vitor Pamplona
2026-08-19 15:40:59 -04:00
committed by GitHub
2 changed files with 11 additions and 2 deletions
@@ -98,7 +98,12 @@ fun RenderChannelInvite(
accountViewModel: AccountViewModel,
nav: INav,
) {
val workspaces = accountViewModel.account.buzzWorkspaces.flow.value
// Collected, not read as .value: the workspace set arrives asynchronously (a 13534 roster landing
// after this row is first drawn), and a plain .value read is a one-shot snapshot that never
// recomposes — so an invite drawn before its workspace was known would stay blank. This is what
// Compose's StateFlowValueCalledInComposition lint flags.
val workspaces by accountViewModel.account.buzzWorkspaces.flow
.collectAsStateWithLifecycle()
val notice = remember(note, workspaces) { note.toMembershipNotice(workspaces) } ?: return
// A withdrawn membership is not an invite. The projection already excludes these before a card is
// built; re-checked here because this renderer is reachable from any NoteCompose over a 44100.
@@ -644,7 +644,11 @@ private fun ChannelInviteRoomCompose(
accountViewModel: AccountViewModel,
nav: INav,
) {
val workspaces = accountViewModel.account.buzzWorkspaces.flow.value
// Collected rather than read as .value, for the same reason as RenderChannelInvite: the workspace
// set lands asynchronously, and a snapshot read never recomposes, so a row drawn before its
// workspace was known would never appear.
val workspaces by accountViewModel.account.buzzWorkspaces.flow
.collectAsStateWithLifecycle()
val notice = remember(inviteNote, workspaces) { inviteNote.toMembershipNotice(workspaces) } ?: return
val baseChannel =
remember(notice) { LocalCache.getOrCreateRelayGroupChannel(GroupId(notice.channelId, notice.relay)) }