• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

share / sharedb / 1391 / 2
97%
master: 97%

Build:
Build:
LAST BUILD BRANCH: dependabot/github_actions/actions/checkout-6
DEFAULT BRANCH: master
Ran 15 Apr 2020 04:12PM UTC
Files 35
Run time 3s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

15 Apr 2020 04:11PM UTC coverage: 97.356% (-0.002%) from 97.358%
1391.2

push

travis-ci

Alec Gibson
Only allow a single subscribe/unsubscribe request to be in-flight

This change is a rework of our subscribe/unsubscribe logic. At the
moment, subscribe and unsubscribe messages are handled completely
separately, which means that we can hit race conditions when
simultaneous subscribe and unsubscribe requests are submitted.

This currently manifests itself in this bug:

  1. `subscribe()`
  2. `unsubscribe()` synchronously (ie before receiving the `subscribe`
     response
  3. Expect to finish unsubscribed. Indeed, `Doc` claims that I'm
     unsubscribed, but actually - because subscribe happens to take a
     bit longer on the server - I'm really still subscribed

This change reworks subscribe and unsubscribe requests into a queue:

  - there may only ever be a single in-flight subscribe or unsubscribe
    request
  - other requests are queued and only submitted once we complete the
    in-flight request

# Special cases

In order to maintain existing behaviour, we also handle a couple of
special cases:

  - if there is _only_ a single subscription request (inflight, or
    pending), and a duplicate request is submitted by the client, we
    just roll the callback into the existing request
  - if the next request is an unsubscribe, we will immediately call back
    if disconnected (but we no longer call them if there is a preceding
    subscribe waiting)

1427 of 1653 branches covered (86.33%)

3093 of 3177 relevant lines covered (97.36%)

179.53 hits per line

Source Files on job 1391.2
  • Tree
  • List 0
  • Changed 14
  • Source Changed 3
  • Coverage Changed 14
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Build 1326
  • Travis Job 1391.2
  • a4178492 on github
  • Prev Job for on unsubscribe-bug (#1386.1)
  • Next Job for on unsubscribe-bug (#1395.1)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc