// ─── Realtime no-op shim (appended to local-api.ts at image build) ─── // // The local Flask API has no websocket/realtime layer -- upstream's LOCAL_MODE.md // says so outright ("Realtime subscriptions -- NOT migrated"), but the adapter it // ships still lacks `.channel()`, so every component that opens a subscription // (useSubscription, useCurrentEvent, social, realm multiplayer) throws // "TypeError: supabase.channel is not a function" and trips the ErrorBoundary -- // the whole app renders "Something went wrong". // // These stubs satisfy the call shape and do nothing. Reads still work: the app // fetches through the normal query path. What is lost is live push updates, which // are meaningless on a single-user instance with no other clients to sync from. Object.assign(supabase as any, { channel: (_name?: string, _opts?: any) => { const ch: any = { on: () => ch, // chainable, never fires subscribe: (cb?: (status: string) => void) => { cb?.('SUBSCRIBED'); return ch; }, unsubscribe: async () => 'ok', presenceState: () => ({}), // realm multiplayer: nobody else here track: async () => 'ok', untrack: async () => 'ok', send: async () => 'ok', }; return ch; }, removeChannel: async () => 'ok', removeAllChannels: async () => 'ok', getChannels: () => [], });