rename replay query parameter to initChannelState
Some checks failed
check / check (push) Has been cancelled
Some checks failed
check / check (push) Has been cancelled
Rename ?replay=1 to ?initChannelState=1 across server, SPA, and docs per review feedback: the parameter initialises fresh channel state rather than replaying past state. - Rename replayChannelState() to initChannelState() - Update query parameter check in HandleState - Update SPA fetch URL and comments - Update README documentation and curl examples
This commit is contained in:
@@ -1036,7 +1036,7 @@ Return the current user's session state.
|
||||
|
||||
| Parameter | Type | Default | Description |
|
||||
|-----------|--------|---------|-------------|
|
||||
| `replay` | string | (none) | When set to `1`, enqueues synthetic JOIN + TOPIC + NAMES messages for every channel the session belongs to into the calling client's queue. Used by the SPA on reconnect to restore channel tabs without re-sending JOIN commands. |
|
||||
| `initChannelState` | string | (none) | When set to `1`, enqueues synthetic JOIN + TOPIC + NAMES messages for every channel the session belongs to into the calling client's queue. Used by the SPA on reconnect to restore channel tabs without re-sending JOIN commands. |
|
||||
|
||||
**Response:** `200 OK`
|
||||
```json
|
||||
@@ -1070,9 +1070,9 @@ curl -s http://localhost:8080/api/v1/state \
|
||||
-H "Authorization: Bearer $TOKEN" | jq .
|
||||
```
|
||||
|
||||
**Reconnect with channel replay:**
|
||||
**Reconnect with channel state init:**
|
||||
```bash
|
||||
curl -s "http://localhost:8080/api/v1/state?replay=1" \
|
||||
curl -s "http://localhost:8080/api/v1/state?initChannelState=1" \
|
||||
-H "Authorization: Bearer $TOKEN" | jq .
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user