# PWA closes the Supabase Realtime socket when switching tabs — solution with “event listener + auto-resubscribe” in WeWeb

**URL:** <https://community.weweb.io/t/pwa-closes-the-supabase-realtime-socket-when-switching-tabs-solution-with-event-listener-auto-resubscribe-in-weweb/20185>\
**Category:** Tips and Hacks\
**Tags:** workflows, supabase, weweb\
**Created:** [October 17, 2025, 12:55am UTC](https://community.weweb.io/t/pwa-closes-the-supabase-realtime-socket-when-switching-tabs-solution-with-event-listener-auto-resubscribe-in-weweb/20185 "2025-10-17T00:55:16Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![Philibert](https://avatars.discourse-cdn.com/v4/letter/p/ee7513/32.png) [@Philibert](https://community.weweb.io/u/Philibert)\
**Post date:** [February 27, 2026, 5:52pm UTC](https://community.weweb.io/t/pwa-closes-the-supabase-realtime-socket-when-switching-tabs-solution-with-event-listener-auto-resubscribe-in-weweb/20185/4 "2026-02-27T17:52:02Z")

</div>

Hello ! Any advances ?  
As i said here : [Realtime subscription works in editor, not in live version - #9 by Philibert](https://community.weweb.io/t/realtime-subscription-works-in-editor-not-in-live-version/20180/9)

Even the fist subscription to the channel is not working (yet works in editor in weweb)  
(Browser console : WebSocket connection to ‘ws://localhost:XXXX/’ failed:)  
Any clues on that ?  
Thank you !

---

_[View the full topic](https://community.weweb.io/t/pwa-closes-the-supabase-realtime-socket-when-switching-tabs-solution-with-event-listener-auto-resubscribe-in-weweb/20185)._
