aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-hub/src/meshbay_hub/static/group-page.js
diff options
context:
space:
mode:
authorChristophe Besson <cbesson@gmail.com>2026-10-17 10:11:07 +0200
committerChristophe Besson <cbesson@gmail.com>2026-10-17 10:11:07 +0200
commit7e61d16f0ca6aeca6adb1dd909a7e7b0376719f9 (patch)
tree08466d6c6879efd1f2c21a118919cb99835fb31f /packages/meshbay-hub/src/meshbay_hub/static/group-page.js
parent6329beaca34e31749ff0343d02e27db2826157e7 (diff)
downloadmeshbay-7e61d16f0ca6aeca6adb1dd909a7e7b0376719f9.tar.gz
fix(spa): follow the device to another network
Moving between mobile data and the node's Wi-Fi left the connection on the network it had left until ICE gave up, and a group that had failed was never tried again: the Android application had to be killed. A change of network or an ICE disconnection now pings the session and reconnects one that does not answer, wakes a reconnect backing off, and retries a group page left on an error. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'packages/meshbay-hub/src/meshbay_hub/static/group-page.js')
-rw-r--r--packages/meshbay-hub/src/meshbay_hub/static/group-page.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/packages/meshbay-hub/src/meshbay_hub/static/group-page.js b/packages/meshbay-hub/src/meshbay_hub/static/group-page.js
index 5972e000..728ffc37 100644
--- a/packages/meshbay-hub/src/meshbay_hub/static/group-page.js
+++ b/packages/meshbay-hub/src/meshbay_hub/static/group-page.js
@@ -789,6 +789,18 @@ function GroupPage({ groupId, group, token, username, userId, userPrefs,
// it; nothing in between should disturb a working connection.
}, [groupId, Boolean(token), retryKey]);
+ // A group that could not be reached is tried again when the device joins
+ // another network: from the Wi-Fi to mobile data, or back, is what decides
+ // whether the node can be reached, and in the Android application there is
+ // no reload to do it. Not while a code, a passphrase or a device link is
+ // asked for: those wait for the person, not for a network.
+ useEffect(() => {
+ if (status !== 'error' || needsPass || needsCode || needsDevice) return undefined;
+ const T = window.MeshBayTransport;
+ if (!T || !T.onNetworkChange) return undefined;
+ return T.onNetworkChange(() => setRetryKey((k) => k + 1));
+ }, [status, needsPass, needsCode, needsDevice]);
+
const downloadFileForModal = useCallback(async (entry) => {
// The video/preview modals' own download button — the table's row and
// toolbar actions call the same shared helper from files-app.js, since