Repository navigation
Commit d79634e
committed
Drop what the server has gone longest without reading
The count bound popped whatever had been dispatched first, so a handler
which kept one event object open across an await could come back and find
the page had dropped it while unrelated keystrokes piled up behind it. A
read now moves an entry to the live end of the queue, so what goes when
the registry is full is the object which has gone longest without being
asked about.
Which bound fired is worth saying out loud. An object which went idle
unread answers "not-found" as before, while one dropped to make room
answers "evicted" and raises EventProxyEvicted here - still an
EventProxyNotFound, so a handler which does not care keeps working.
Age takes only the objects the server never asked about, and the sweep
runs after a message has been carried out rather than before it. Carrying
one out is the proof an object is wanted, so sweeping first used to delete
the very object a request had arrived for, and answer a handler which was
still working that the page had gone away on its own.
Dispatching an object which is already registered now gives back the id
the server holds rather than a second copy of the same thing, and
DEFAULT_MAX_DEPTH is gone: serializeValue states its own bound, and a
request which does not say how deep it may go gets a reference rather than
a depth somebody guessed.1 parent 6a59bcc commit d79634e
4 files changed
Lines changed: 541 additions & 68 deletions
File tree
- src
- js/packages/@reactpy/client
- src
- tests
- reactpy
- tests/test_core
0 commit comments