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
{{ message }}
Repository navigation
[Bug]: Shared file list goes stale after SSE reconnect — deleted / expired files never removed on client #482
The client keeps its shared-file list in sync through the event stream at GET /api/files/events. When a client connects, handleFileEvents in src/server/signalling/handlers/fileShare.ts (lines 397-412) replays every file in fileStore as an incoming-file event.
On the client, src/contexts/FileShareContext.tsx (lines 160-170) only ever adds files:
A file is removed only when a file-deleted event arrives. EventSource reconnects automatically after Wi-Fi drops, the phone sleeps, or the server restarts, but any file-deleted events sent while the client was disconnected are lost. The replay after reconnecting only adds files and never removes any, so the client keeps entries that no longer exist on the server.
The worst case is a server restart. fileStore is in memory, so a restart empties it, yet every connected client keeps showing all the old files, and each download returns 404 File not found.
es.onerror = () => {} (line 174) also hides the disconnect completely, so nothing tells the user the list may be out of date.
Steps to Reproduce
Start the Rein server and open the client on a phone.
Upload a file. It appears in the shared files list.
Restart the server (Ctrl+C, then npm run dev).
Wait for EventSource to reconnect, which happens automatically within a few seconds.
The file is still listed on the client. Tapping download returns 404 {"error":"File not found"}.
Alternative: disconnect client A from the network, delete the file from client B, then reconnect client A. Client A still shows the file.
Expected Behavior
When a client connects, the server should send one snapshot event with the full current file list instead of one incoming-file event per file:
This brings the client back in sync on every connect and reconnect, whether the change was a deletion, a restart or anything else that happened while it was offline.
Desktop Operating System
Other
Client OS and browser
All clients / Any browser
Rein Version
1.0.0
Console Logs / Error Messages (Optional)
GET /api/files/download?fileId=<stale-id> -> 404 {"error":"File not found"}
Screenshots / Recordings (Optional)
No response
Checklist
I have searched for existing issues to avoid duplicates
Activity
github-actions commentedon Nov 15, 2026
Discussions are carried on Discord.
Instead of commenting here, go to the Discord channel.
RITVIKKAMASETTY commentedon Nov 15, 2026
if issue is valid please assign me
fix(file-share): end the event stream when the initial snapshot canno…
fix(file-share): resync the shared file list when the event stream re…