Repository navigation
Release 0.1.2: deadlines for latest calls, SEAM1403 and poll - #2
Merged
Merged
Conversation
…t drops its signal, and add poll A latest line gets within(ms): a call that has not settled in time aborts its signal and resolves to Timeout, or to Stale if a newer call started, so the latest-wins rule still holds. SEAM1403 reports a fetch in a latest function's body that does not take the function's signal, which kept running after the call was dropped. poll reads one at a time, backs off after failures and pauses while the page is hidden. All three were found by CS Pro's chat widget, which raced fetch against setTimeout by hand.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Deadlines, polling and a check for requests that outlive their call, found by CS Pro's chat widget (the first production app). Details in CHANGELOG.md and DECISIONS.md ("Deadlines, polling and fetch signals").
f.within(ms)(...args): a latest call with a deadline. Out of time, it aborts its signal and resolves toTimeout;Stalestill wins if a newer call started.fetchin a latest function that does not take the function's signal, with a quick fix.poll(read, { every, maxEvery?, onResult })in@seamscript/runtime: one read at a time, backoff after failures, paused while the page is hidden.yarn testpasses (runtime 193, compiler 170, and the rest).