Bug: Messages not appearing on first run after 'make clean setup dev' #66
Labels
No labels
area:api
area:core
area:docs
area:infra
area:ux
dependencies
documentation
duplicate
good first issue
help wanted
invalid
question
rust
status:complete
status:partial
status:planned
type:bug
type:design
type:feature
type:infra
type:refactor
type:research
type:ux
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
icub3d/decentcom#66
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Migrated from GitHub issue icub3d/decentcom#93
Original Author: @icub3d
Original Date: 2026-04-18T20:29:19Z
Overview
When running
make clean setup dev, the client successfully connects and shows the server/channels, but the message list remains empty. Restarting the client fixes the issue, suggesting a race condition during the initial environment bootstrap.Background
The
make clean setup devcommand:localStorage.OPENas current server with messages).overmind.Requirements
Potential Causes & Design Changes
1. App Store Rehydration Race
In
App.tsx,initAppStoreForAccountis called in auseEffect. This function explicitly setscurrentServerIdtonullbefore callingrehydrate().If the auto-connect effect triggers before or during this, it may use a stale or
nullserver ID, or trigger multiple connection attempts.2. Connection Status Flapping
In
useServerStore.ts,connect()fetches channels/roles, then callsgateway.reconnect(), thenloadMoreMessages().The WebSocket
onopenhandler setsstatus: 'connected'as soon as the socket opens. This might happen BEFOREloadMoreMessagesfinishes, causing the UI to render an empty list (asmessagesis still{}).3. Server Startup Latency
cargo watchtakes a few seconds to start the server. The client retries immediately on failure, which might lead to a state where it thinks it's connected but failed to fetch initial data.Task List
initAppStoreForAccountto avoid unnecessarynullstate if the account hasn't actually changed.useServerStore.connectclears previous messages/channels to avoid stale data.loadingMessagesstate or similar touseServerStoreto distinguish between "fetching" and "no messages".App.tsx.Test List
make clean setup devand verify messages appear in#generalon the first client load.