djust 1.0.0rc9

Pre-releaseReleased
Install
pip install djust==1.0.0rc9

This is a pre-release. djust 1.0.0 has shipped since: read the djust 1.0.0 release notes.

Before you upgrade, read the upgrade guide.

Fixed

  • Wizard {% if/elif %} step-leak (#1552) — root cause fixed at the WS-mount LOAD path. Bisect on the reporter's consumer (NYC Claims wizard) narrowed the regression window to 0.9.7rc1 (GOOD) → 0.9.7rc2 (BAD), with PR #1466 / commit a5e2c50c (feat(websocket): persist LiveView state on WS event for reconnect continuity) as the single feature commit in that window. PR #1466 changed handle_mount's LOAD gate from if has_prerendered: to if has_prerendered or saved_state: AND made the request.session.aget(view_key, {}) read itself unconditional — every view got its previously-saved session state restored on every WS mount, including views that never opted in via enable_state_snapshot. For non-opt-in views, that restoration ran AFTER mount() had initialized the view; the next render_with_diff() then diffed against a baseline clobbered by the session-restored state, producing patches that reference dj-ids that don't correspond to the client's actual DOM. The applier's querySelector(':scope > [dj-id=X]') failed, fell back to index resolution, and removed the wrong node after InsertSubtree had shifted positions — the old wizard-step subtree survived in the DOM. Visible symptom: the #1552 wizard step-leak. PR #1478 (commit 066d7f05, closing issue #1475) later added a SAVE-side gate on enable_state_snapshot, fixing snapshot-on-idle write amplification but leaving the LOAD path unconditional — so the client-DOM-mismatch bug introduced by PR #1466 survived through 0.9.7rc3, 0.9.7 final, and all 1.0.0 rcs through rc8. The fix gates the saved_state read in handle_mount symmetrically with PR #1478's SAVE-block gate: saved_state = await request.session.aget(view_key, {}) if request.session and getattr(self.view_instance, "enable_state_snapshot", False) else {}. Behavior preserved for opt-in views (enable_state_snapshot = True) — PR #1466's reconnect-resume capability still fires for them. Behavior restored to 0.9.7rc1 for default views. Verified end-to-end on the consumer (#1552 reporter's NYC Claims wizard, djust==1.0.0rc8 + this patch): step 1 → 2 → 3 → back transitions all produce exactly one h2.card-title in the DOM, no leak. PR #1466's 10 reconnect tests (python/djust/tests/test_ws_reconnect_state_1465.py) preserved unchanged for opt-in coverage; the test_load_gate_loosened_fires_on_saved_state_without_has_prerendered assertion was strengthened to require BOTH request.session AND enable_state_snapshot in the gate (passes Action #1200/#1468 gate-off self-test). First PR in the #1552 saga to satisfy the multi-reopen rule (Action #1389 / PR #1086 precedent) via bit-exact end-to-end verification on the reporter's exact environment; PRs #1553 (test-pinning), #1555 (dj-id counter fix — adjacent issue), and #1564 (framework-pin investigation) worked at framework-synthetic shapes and could not reproduce the user-visible symptom because the bug lived in the LOAD path that those reproducers exercised correctly.

All releases · Atom feed