where_is_waldo 0.1.15 → 0.1.16
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +45 -0
- data/README.md +26 -0
- data/VERSION +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c5bbdc6480c178670602c5f3749370dced0ef932e99d49c5a753eb3ceef3ed9e
|
|
4
|
+
data.tar.gz: e8b3d2db9b9179ae9828c7637b772f9f9b9dde5b82cfc1a756c524b8d701694f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d92709f8debef9199e51190a7a1952f132af7657faba25d1df174c58e7b841da9fdbd76ad5ef2c50cb922866f49c14306abbe78bfd86cff350564cf819a57715
|
|
7
|
+
data.tar.gz: 771c824d4eef5c3d02883389dc51ae8197342bb24196d18d00cc07bcba1ba971c654a98a7a285d5d81d574e78d550c28f8a9350212f3da65b38260c2510d7f80
|
data/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,51 @@ Notable changes to where_is_waldo. Format loosely follows
|
|
|
5
5
|
|
|
6
6
|
## Unreleased
|
|
7
7
|
|
|
8
|
+
## 0.1.16 - 2026-11-11
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- **A client could stop reconnecting FOREVER, and nothing in ActionCable would
|
|
13
|
+
turn it back on.** ActionCable's `ConnectionMonitor` is the only thing that
|
|
14
|
+
reconnects a dropped socket, and it can be switched off permanently:
|
|
15
|
+
|
|
16
|
+
```js
|
|
17
|
+
close({allowReconnect}) { if (!allowReconnect) { this.monitor.stop() } }
|
|
18
|
+
stop() { this.stopPolling(); removeEventListener("visibilitychange", ...) }
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
`stop()` unregisters the very listener that would notice the tab being
|
|
22
|
+
focused again, and nothing re-registers it. The far end can trigger this
|
|
23
|
+
from outside the browser: Rails sends a disconnect with `reconnect: false`
|
|
24
|
+
for an unauthorized or remotely-disconnected connection.
|
|
25
|
+
|
|
26
|
+
Observed in production: a socket closed and the tab then ran for SEVEN AND A
|
|
27
|
+
HALF HOURS -- visible, focused, making ordinary HTTP requests -- without a
|
|
28
|
+
single further WebSocket attempt. Presence stayed empty the whole time and
|
|
29
|
+
anything broadcast to online subscribers missed it. Nothing was refused;
|
|
30
|
+
nothing was attempted.
|
|
31
|
+
|
|
32
|
+
There is now a watchdog: while a connection is wanted, waldo notices a
|
|
33
|
+
monitor that has stopped and starts it again, on a 10-second interval and on
|
|
34
|
+
its own `visibilitychange` listener. It deliberately does NOTHING while the
|
|
35
|
+
monitor is running, so it never opens a competing socket or interferes with
|
|
36
|
+
ActionCable's backoff, and it never undoes a deliberate `disconnectCable()`
|
|
37
|
+
or a teardown from `configureCable()`.
|
|
38
|
+
|
|
39
|
+
### Added
|
|
40
|
+
|
|
41
|
+
- `checkConnection()` is exported. It performs one watchdog pass and returns
|
|
42
|
+
what it did (`open`, `monitor-running`, `monitor-restarted`, `opened`,
|
|
43
|
+
`not-wanted`, `no-consumer`, `error`), which makes the recovery path
|
|
44
|
+
testable and gives an application a way to force a check -- after a resume
|
|
45
|
+
from sleep, say.
|
|
46
|
+
|
|
47
|
+
### Changed
|
|
48
|
+
|
|
49
|
+
- Every read of ActionCable's internals is guarded and returns `error` rather
|
|
50
|
+
than throwing, so a future rename inside ActionCable degrades the watchdog
|
|
51
|
+
instead of breaking a consumer's render or heartbeat.
|
|
52
|
+
|
|
8
53
|
## 0.1.15 - 2026-11-10
|
|
9
54
|
|
|
10
55
|
### Fixed
|
data/README.md
CHANGED
|
@@ -81,6 +81,32 @@ configureCable({
|
|
|
81
81
|
</PresenceProvider>
|
|
82
82
|
```
|
|
83
83
|
|
|
84
|
+
### Reconnection
|
|
85
|
+
|
|
86
|
+
ActionCable reconnects dropped sockets through its own `ConnectionMonitor`, and
|
|
87
|
+
that is still what does the work here. But the monitor can be switched off
|
|
88
|
+
permanently -- `close({allowReconnect: false})` calls `monitor.stop()`, which
|
|
89
|
+
unregisters its `visibilitychange` listener, and nothing in ActionCable
|
|
90
|
+
re-registers it. Rails sends a disconnect with `reconnect: false` for an
|
|
91
|
+
unauthorized or remotely-disconnected connection, so the far end can put a
|
|
92
|
+
browser tab permanently offline.
|
|
93
|
+
|
|
94
|
+
Since 0.1.16 waldo watches for that: while a connection is wanted it notices a
|
|
95
|
+
stopped monitor and starts it again, on a 10-second interval and on its own
|
|
96
|
+
visibility listener. It does nothing while the monitor is running, so it never
|
|
97
|
+
opens a competing socket, and it never undoes a deliberate `disconnectCable()`.
|
|
98
|
+
|
|
99
|
+
`checkConnection()` runs one pass on demand and returns what it did, which is
|
|
100
|
+
useful after a resume from sleep or any point an app knows more than a timer
|
|
101
|
+
does:
|
|
102
|
+
|
|
103
|
+
```jsx
|
|
104
|
+
import { checkConnection } from '@byscott-io/where-is-waldo';
|
|
105
|
+
|
|
106
|
+
// e.g. after regaining network
|
|
107
|
+
window.addEventListener('online', () => checkConnection());
|
|
108
|
+
```
|
|
109
|
+
|
|
84
110
|
### `getToken` and short-lived tokens
|
|
85
111
|
|
|
86
112
|
`getToken` is called **once per connection attempt**, not once at startup. That
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.1.
|
|
1
|
+
0.1.16
|