Repository navigation
Conversation
A client with a peer no longer polls over axios while the peer source is pending, while the peer is not open yet, or while it reconnects: its topics wait and are subscribed on the socket when it opens, then catch up by rev. A socket-only topic subscribed before the source returned the open peer was polled over REST and refused. Axios carries the polls without a peer, after the peer closed for good, and while the peer source throws or rejects.
✅ Incremental coverage — 96.9%
9 files not graded (2 ignored by pattern, 7 not source files)
Coverage reports: coverage.json (coverage.py, 76 files) · coverage/clover.xml (clover, 17 files) — incremental-coverage-check v3.1.0 |
Contributor
Author
|
Closed: the connection topic is the only socket-bound topic; the fix goes into taskwire (subscribe the connection topic once the event client has an open socket). The event client's REST/socket rule stays unchanged. |
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.
Problem
The event client polled a new topic over axios whenever it had no open peer. With a peer source
(
createEventClient({ peer: () => currentPeer() })), a topic subscribed right after the muxws socket opened,but before the source returned that peer, went to
POST /events/poll. taskwire'sattachViewsetEventssubscribes its socket-only connection topic (
taskwire:c.…) exactly then; the server refuses that topic overREST (403), so taskwire marked its socket transport unhealthy and fell back to polling. The outcome depended on
which of the two resolved first.
Rule
When a peer is configured, topics are subscribed once the muxws connection is established; REST polling is only
for when there is no connection.
willRetry: trueonReconnectsubscribe().readystill resolves once the topic is followed (socket answer or poll answer);close()while atopic waits rejects
readywithError('The event client is closed'); a subscription removed while waiting isnot subscribed;
refresh()of a waiting topic is answered by thesubscribesent when the socket opens; a gapof a waiting topic is caught up by that
subscribeanswer.Changed existing tests (
vue/events/client.spec.ts)Behaviour on a reconnecting peer changed (case 3), so tests that used a retried close to reach the axios
fallback now use a close for good, and keep checking the same axios rules:
losing the peer … resumes the ladder on its base rung over axios,… while a rung polls over it …,… while the ladder waits …,drops a subscribe answer from the lost socket …,a gap poll that failed before the peer closed …,sends a gap poll over axios at once while the peer is closed,the check poll: sends nothing while the peer is closed; the ladder polls over axios:close()(willRetry)→
closeForGood(); titles say "for good".on reconnect subscribes every topic; an equal rev resumes …: no longer answers an axios poll while the peeris away; it now asserts that nothing is sent during the close.
polls over axios while the peer is not open, and subscribes once it reconnects→polls nothing over axios while the peer is not open yet, and subscribes once it opens(case 5).peer source: polls over axios after the peer closes for good …: on adoption the client no longer sends apoll at once next to the
subscribe; the test asserts only thesubscribeand no axios call.Tests
close()and unsubscribe while waiting (waiting for the socket); all but theones for unchanged behaviour (source throws, no peer) fail on
main.vue/muxws-real.spec.ts): a socket-only topic subscribed before thesource returns the open peer is subscribed on the socket, with axios answering 403 never called.
vue/viewset-events,vue/muxws,vue/busy/baseandpackagingspecs pass against this build, anda temporary test reproducing the klubis race (
ViewsetEventsTransportwith a pending peer source) fails on 0.16.5and passes on this build. No change in taskwire needed.
events.spec.ts(Chromium and Firefox) passes.Version 0.16.6 (patch: bug fix).