fix: federation reaction identity + remote server reload race condition

- Include user object in reaction_added WS broadcasts for isSelf() resolution
- Use isSelf() instead of userId comparison for reaction ownership checks
- Load remote server detail after ready event to prevent empty channel list
This commit is contained in:
Jannis Braun
2026-03-04 03:53:07 +01:00
parent dca9c4dc83
commit f7809cf457
3 changed files with 32 additions and 6 deletions
+13
View File
@@ -118,6 +118,19 @@ function handleEvent(origin: string, event: ServerEvent): void {
loadServerDetail(currentServerId);
}
// For remote instances: if user was viewing one of these servers, load its details
// (fixes race condition on page reload — route params effect fires before remote WS connects)
if (!isHome) {
const { currentServerId: curServerId, loadServerDetail: loadDetail } = useServerStore.getState();
if (curServerId && event.servers.some((s: any) => s.id === curServerId)) {
loadDetail(curServerId);
const { currentChannelId, loadMessages } = useChatStore.getState();
if (currentChannelId) {
loadMessages(currentChannelId, true);
}
}
}
// Only force-reload the current channel on reconnect; other channels keep their cache
if (isHome) {
const { loadMessages: reloadMessages, currentChannelId, setReadStates } = useChatStore.getState();