Commit da53877
authored
Send a "reconnect" hydrate whenever the socket reconnects (#5969)
* Send a "reconnect" hydrate whenever the socket reconnects
* "reconnect" hydrate doesn't reset client storage or trigger on_load, it just
returns the latest complete state dict
* this event is driven by the frontend after the socket connects
* update `link_token_to_sid` to NOT emit a delta when the sid changes for a
token; the client will be informed of this during the initial hydrate or
"reconnect" hydrate.
Fix #5963
* fix lost+found test case
* make sure there is a hydrate event before we assume
if the app is stateless, then presumably we don't end up connecting a websocket
at all, so we wouldn't hit this code. also if `initialEvents` was empty for
whatever reason, then the app probably wouldn't work... but lets make it look a
bit safer.
* oops mocked app isn't based on real app1 parent d3c4273 commit da53877
File tree
4 files changed
+27
-7
lines changed- reflex
- .templates/web/utils
- middleware
- tests/units/utils
4 files changed
+27
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
568 | 568 | | |
569 | 569 | | |
570 | 570 | | |
| 571 | + | |
571 | 572 | | |
572 | 573 | | |
573 | 574 | | |
| |||
615 | 616 | | |
616 | 617 | | |
617 | 618 | | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
618 | 635 | | |
619 | 636 | | |
620 | 637 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2263 | 2263 | | |
2264 | 2264 | | |
2265 | 2265 | | |
2266 | | - | |
| 2266 | + | |
2267 | 2267 | | |
2268 | 2268 | | |
2269 | 2269 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
43 | 46 | | |
44 | 47 | | |
45 | 48 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
519 | 519 | | |
520 | 520 | | |
521 | 521 | | |
522 | | - | |
| 522 | + | |
523 | 523 | | |
524 | 524 | | |
525 | 525 | | |
| |||
0 commit comments