fix(events): cancel disconnected page-load chains

Merged
KR
19h ago
+450-29

Summary

Page-load handlers keep running after their client disconnects, retaining state locks and repeatedly trying to send updates to a closed socket. Cancel that work when the current socket disconnects.

Closes #7251.

What changed

  • Cancel unfinished page-load chains, including self-chained descendants and queued hydration.
  • Check socket ownership so a stale disconnect cannot cancel a replacement connection's load. Preserve independent foreground and background events.
  • Add lifecycle regressions, page-load documentation and package news fragments. Raise the reflex-base dependency floor for the new processor hook.

Verification

  • 11,196 unit tests passed; 155 skipped; 78.99% coverage.
  • Ruff lint and format checks, pyright reflex tests and changed-file pre-commit hooks passed.
  • A real Socket.IO disconnect stopped a polling handler; independent background work completed and the same token reconnected successfully.
  • The reflex-base minimum-dependency check passed. Root dependency resolution fails on an existing hosting CLI/build SDK conflict. Full-repository pre-commit also hits six macOS benchmark typing errors. Both failures reproduce on clean upstream/main.

Deployment notes

No configuration changes. Page-load handlers and their chained events now receive cancellation on disconnect, matching navigation and reconnect behavior. Existing Redis cancellation-persistence behavior is unchanged and tracked separately in #7248.