@antzsoft/chat-core 1.3.6 → 1.3.7

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.
package/README.md CHANGED
@@ -3056,6 +3056,22 @@ document.querySelectorAll('[data-conv-id]').forEach((el) => {
3056
3056
 
3057
3057
  ## Changelog
3058
3058
 
3059
+ ### v1.3.7
3060
+
3061
+ - **Docs only — no code changes.** Brought the docs fully up to date: added the missing
3062
+ release notes to `docs/integration-guide.html` (its "What's New" section had stopped at
3063
+ v1.3.4) so both the README changelog and the HTML integration guide now cover v1.3.5,
3064
+ v1.3.6, and this v1.3.7 entry. No SDK behaviour changed in this version; upgrading from
3065
+ 1.3.6 is a no-op at runtime.
3066
+
3067
+ ### v1.3.6
3068
+
3069
+ - **Fix: `reconnectSocket` now PRESERVES the transit session instead of recreating it** — follow-up to the 1.3.5 reconnect fix. 1.3.5 fixed `"Transit encryption required"` by disconnecting and re-running the full `connectSocket()` handshake, but that also cleared the cached transit session (the `'disconnect'` handler calls `clearTransitSession()`) and established a brand-new one with a new session key. Server-broadcast events (e.g. `user_online`) are encrypted with the session the server still holds, so a fresh client key could not decrypt them → continuous `"Transit decryption failed for event: user_online"`.
3070
+
3071
+ `reconnectSocket` is a token-only refresh — the transit session is still valid on the server (stored in Redis by `sessionId`, re-linked to the new socket on reconnect). So it now carries the existing `transitSessionId` forward in the handshake auth and reconnects the **same** socket **without** disconnecting, keeping the client's session key intact. The server re-links the same session (`getBySessionId` + `linkSocket`), so both sides keep the same key and decryption continues to work. Falls back to the full `connectSocket()` flow only when there is no valid cached session to preserve.
3072
+
3073
+ Net: keeps 1.3.5's "no more `Transit encryption required` on reconnect" while removing the `user_online` decryption-failure regression. **No integration changes required.**
3074
+
3059
3075
  ### v1.3.5
3060
3076
 
3061
3077
  - **Fix: `reconnectSocket()` no longer drops the transit-encryption handshake** — when transit encryption is enabled, `reconnectSocket()` now delegates to the full `connectSocket()` flow instead of doing a bare `_socket.auth` swap. `reconnectSocket()` predates transit encryption and was never migrated: it overwrote `_socket.auth` with only `{ token, userId, tenantId }`, dropping the `transitSessionId` / `transitEphemeralPub` fields that `connectSocket()` sets during the handshake. Combined with the `'disconnect'` handler clearing the cached transit session, a reconnect after the socket had disconnected (e.g. app returning to foreground on iOS/Android, where backgrounding fully disconnects) went out with no transit auth and no cached session → the server rejected the handshake with **"Transit encryption required: missing transitEphemeralPub/transitAlgo in handshake auth"**. It was intermittent — fast devices whose cached transit session survived the reconnect were unaffected.
@@ -155,7 +155,7 @@ section.sec>h2:hover{color:#fff}
155
155
 
156
156
  <div class="section-label">What's New</div>
157
157
  <ul>
158
- <li><a href="#whats-new">v1.3.4 Release Notes</a></li>
158
+ <li><a href="#whats-new">v1.3.7 Release Notes</a></li>
159
159
  </ul>
160
160
 
161
161
  <div class="section-label">Getting Started</div>
@@ -250,12 +250,85 @@ section.sec>h2:hover{color:#fff}
250
250
  <h2>What's New</h2>
251
251
  <p style="color:var(--muted);font-size:13px;margin-bottom:20px">Version history and release notes. Click a version to expand.</p>
252
252
 
253
- <!-- ── v1.3.4 (current) ── -->
253
+ <!-- ── v1.3.7 (current) ── -->
254
+ <div class="wn-version open" id="wn-137">
255
+ <div class="wn-header" onclick="toggleVersion('wn-137')">
256
+ <div class="wn-title">
257
+ <span class="wn-ver">v1.3.7</span>
258
+ <span class="wn-badge current">Current</span>
259
+ <span class="wn-date">July 2026</span>
260
+ </div>
261
+ <span class="wn-chevron">▲</span>
262
+ </div>
263
+ <div class="wn-body">
264
+ <div class="wn-item" id="wn-137-docs">
265
+ <div class="wn-item-header" onclick="toggleItem('wn-137-docs')">
266
+ <span class="wn-tag fix">Docs</span>
267
+ <span class="wn-item-title">Documentation brought up to date (no code changes)</span>
268
+ <span class="wn-chevron-sm">▾</span>
269
+ </div>
270
+ <div class="wn-item-body">
271
+ <p>This "What's New" section had stopped at v1.3.4. It now includes the v1.3.5 and v1.3.6 reconnect/transit fixes below, and this v1.3.7 entry. <strong>No SDK behaviour changed in 1.3.7</strong> — upgrading from 1.3.6 is a runtime no-op.</p>
272
+ </div>
273
+ </div>
274
+ </div>
275
+ </div><!-- /.wn-version -->
276
+
277
+ <!-- ── v1.3.6 ── -->
278
+ <div class="wn-version open" id="wn-136">
279
+ <div class="wn-header" onclick="toggleVersion('wn-136')">
280
+ <div class="wn-title">
281
+ <span class="wn-ver">v1.3.6</span>
282
+ <span class="wn-date">July 2026</span>
283
+ </div>
284
+ <span class="wn-chevron">▲</span>
285
+ </div>
286
+ <div class="wn-body">
287
+ <div class="wn-item" id="wn-136-transit-preserve">
288
+ <div class="wn-item-header" onclick="toggleItem('wn-136-transit-preserve')">
289
+ <span class="wn-tag fix">Fix</span>
290
+ <span class="wn-item-title"><code>reconnectSocket</code> preserves the transit session instead of recreating it</span>
291
+ <span class="wn-chevron-sm">▾</span>
292
+ </div>
293
+ <div class="wn-item-body">
294
+ <p>Follow-up to the v1.3.5 reconnect fix. v1.3.5 fixed <code>"Transit encryption required"</code> by disconnecting and re-running the full <code>connectSocket()</code> handshake — but that also cleared the cached transit session (the <code>'disconnect'</code> handler calls <code>clearTransitSession()</code>) and established a brand-new one with a new session key. Server-broadcast events (e.g. <code>user_online</code>) are encrypted with the session the server still holds, so a fresh client key could not decrypt them, producing continuous <code>"Transit decryption failed for event: user_online"</code>.</p>
295
+ <p><code>reconnectSocket</code> is a token-only refresh — the transit session is still valid on the server (stored in Redis by <code>sessionId</code>, re-linked to the new socket on reconnect). It now carries the existing <code>transitSessionId</code> forward in the handshake auth and reconnects the <strong>same</strong> socket <strong>without</strong> disconnecting, keeping the client's session key intact. The server re-links the same session, so both sides keep the same key and decryption keeps working. Falls back to the full <code>connectSocket()</code> flow only when there is no valid cached session to preserve (e.g. the socket was already disconnected).</p>
296
+ <p><strong>No integration changes required.</strong> Keeps v1.3.5's "no more <code>Transit encryption required</code> on reconnect" while removing the <code>user_online</code> decryption-failure regression.</p>
297
+ </div>
298
+ </div>
299
+ </div>
300
+ </div><!-- /.wn-version -->
301
+
302
+ <!-- ── v1.3.5 ── -->
303
+ <div class="wn-version open" id="wn-135">
304
+ <div class="wn-header" onclick="toggleVersion('wn-135')">
305
+ <div class="wn-title">
306
+ <span class="wn-ver">v1.3.5</span>
307
+ <span class="wn-date">July 2026</span>
308
+ </div>
309
+ <span class="wn-chevron">▲</span>
310
+ </div>
311
+ <div class="wn-body">
312
+ <div class="wn-item" id="wn-135-transit-reconnect">
313
+ <div class="wn-item-header" onclick="toggleItem('wn-135-transit-reconnect')">
314
+ <span class="wn-tag fix">Fix</span>
315
+ <span class="wn-item-title"><code>reconnectSocket</code> no longer drops the transit-encryption handshake</span>
316
+ <span class="wn-chevron-sm">▾</span>
317
+ </div>
318
+ <div class="wn-item-body">
319
+ <p><code>reconnectSocket</code> predates transit encryption and was never migrated: it overwrote <code>_socket.auth</code> with only <code>{ token, userId, tenantId }</code>, dropping the <code>transitSessionId</code> / <code>transitEphemeralPub</code> fields that <code>connectSocket()</code> sets during the handshake. Combined with the <code>'disconnect'</code> handler clearing the cached transit session, a reconnect after the socket had disconnected (e.g. app returning to foreground on iOS/Android, where backgrounding fully disconnects) went out with no transit auth and no cached session, so the server rejected the handshake with <code>"Transit encryption required: missing transitEphemeralPub/transitAlgo in handshake auth"</code>. Intermittent — fast devices whose cached transit session survived the reconnect were unaffected.</p>
320
+ <p>When transit encryption is on, <code>reconnectSocket</code> now delegates to the full <code>connectSocket()</code> flow (re-establishes/reuses the transit session, rebuilds the handshake auth) instead of a bare auth-swap. It also inherits <code>connectSocket()</code>'s in-flight dedupe, so multiple rapid reconnect calls collapse into one. Non-transit deployments keep the original fast bare auth-swap path unchanged.</p>
321
+ <p><strong>Note:</strong> v1.3.5 introduced a follow-on regression (see v1.3.6) — prefer <strong>1.3.6+</strong>. <strong>No integration changes required</strong> — same <code>reconnectSocket(token, userId, tenantId)</code> signature.</p>
322
+ </div>
323
+ </div>
324
+ </div>
325
+ </div><!-- /.wn-version -->
326
+
327
+ <!-- ── v1.3.4 ── -->
254
328
  <div class="wn-version open" id="wn-134">
255
329
  <div class="wn-header" onclick="toggleVersion('wn-134')">
256
330
  <div class="wn-title">
257
331
  <span class="wn-ver">v1.3.4</span>
258
- <span class="wn-badge current">Current</span>
259
332
  <span class="wn-date">July 2026</span>
260
333
  </div>
261
334
  <span class="wn-chevron">▲</span>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antzsoft/chat-core",
3
- "version": "1.3.6",
3
+ "version": "1.3.7",
4
4
  "description": "Platform-agnostic core for Antz Chat — API, socket, stores, types. Works in browser, React Native (Expo or bare), and Node.js.",
5
5
  "author": "Antz",
6
6
  "license": "MIT",