@dubsdotapp/expo 0.5.26 → 0.5.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dubsdotapp/expo",
3
- "version": "0.5.26",
3
+ "version": "0.5.27",
4
4
  "description": "React Native SDK for the Dubs betting platform",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -155,7 +155,19 @@ export function ChatProvider({ children, autoConnect = true }: ChatProviderProps
155
155
  const host = new URL(baseUrl).origin;
156
156
 
157
157
  chatSocket.setListeners({
158
- onConnectionChange: setStatus,
158
+ // Refetch the message list whenever the socket reaches 'connected'.
159
+ // Covers both the initial connect AND every reconnect (app resumed
160
+ // from background, transient network blip, server restart). Without
161
+ // this, the provider's `messages` state is frozen at whatever it was
162
+ // when the app last connected — Socket.IO's auto-reconnect resumes
163
+ // delivery of *new* events but does not replay the gap.
164
+ onConnectionChange: (next) => {
165
+ setStatus(next);
166
+ if (next === 'connected') {
167
+ refreshMessages().catch(() => {});
168
+ refreshConversations().catch(() => {});
169
+ }
170
+ },
159
171
  // Global chat
160
172
  onNewMessage: (msg) => {
161
173
  setMessages((prev) => {