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

share / sharedb
96%
master: 97%

Build:
Build:
LAST BUILD BRANCH: dependabot/bundler/docs/rexml-3.4.2
DEFAULT BRANCH: master
Repo Added 10 Mar 2016 07:44AM UTC
Files 39
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

LAST BUILD ON BRANCH otapply-rollback
branch: otapply-rollback
CHANGE BRANCH
x
Reset
  • otapply-rollback
  • 1.x-beta
  • ServerStream-clone
  • Teamwork-fix-whenNothingPending
  • add-connection-tests
  • after-write
  • async-2
  • backend-docs
  • broken-connection
  • bug-fix/broken-hard-rollback
  • bug-fix/broken-presence-hardrollback
  • close-milestone-database
  • db-method-options
  • delay-op-for-query-poll
  • delete-docs
  • doc-images-with-height
  • downgrade-stack-warn
  • error-codes
  • eslint
  • examples-ws-update
  • fetch-snapshot-middleware
  • fix-272
  • fix-docs
  • fix-flaky-test
  • fix-lib-hasown-lagacy
  • fix-projection-queries
  • fix-tests-sync-unsub
  • fix-textarea-example
  • getops-options
  • handshake
  • held-ops
  • initialise-paused
  • leadership-readme-update
  • logger-override
  • master
  • middleware-docs-reply
  • null-milestone-db
  • op-batch
  • presence
  • presence-call-each
  • presence-destroy
  • presence-example
  • presence-resubscribe
  • read-docs-middleware
  • readSnapshots-context
  • readSnapshots-specific-errors
  • remove-deprecated-middleware
  • remove-duplicated-type
  • remove-mingo-dep
  • reorganize-pubsub-adapters
  • reply-middleware
  • revert-263-readSnapshots-context
  • revert-shallow-copy-op
  • run-sharedb-mongo-tests
  • server-plugin-query
  • show
  • silence-logger-in-tests
  • snapshot-by-timestamp
  • snapshot-request-test
  • snapshot-throw
  • test-error-visibility
  • test-fixes
  • test-query-poll-doc
  • unsubscribe-bug
  • update-dependencies
  • update-examples
  • update-snapshot-docs
  • use-async
  • use-loglevel
  • v0.11.35
  • v0.11.36
  • v0.11.37
  • v1.0.0
  • v1.0.0-beta.1
  • v1.0.0-beta.10
  • v1.0.0-beta.11
  • v1.0.0-beta.12
  • v1.0.0-beta.13
  • v1.0.0-beta.14
  • v1.0.0-beta.15
  • v1.0.0-beta.16
  • v1.0.0-beta.17
  • v1.0.0-beta.18
  • v1.0.0-beta.19
  • v1.0.0-beta.2
  • v1.0.0-beta.20
  • v1.0.0-beta.21
  • v1.0.0-beta.22
  • v1.0.0-beta.23
  • v1.0.0-beta.24
  • v1.0.0-beta.25
  • v1.0.0-beta.26
  • v1.0.0-beta.27
  • v1.0.0-beta.28
  • v1.0.0-beta.29
  • v1.0.0-beta.3
  • v1.0.0-beta.30
  • v1.0.0-beta.31
  • v1.0.0-beta.4
  • v1.0.0-beta.5
  • v1.0.0-beta.6
  • v1.0.0-beta.7
  • v1.0.0-beta.8
  • v1.1.0
  • v1.2.0
  • v1.2.1
  • v1.3.0
  • v1.3.1
  • v1.3.2
  • v1.3.3
  • v1.3.4
  • v1.4.0
  • v1.4.1
  • v1.4.2
  • v1.5.0
  • v2
  • yet-another-presence

pending completion
926

Pull #259

travis-ci

web-flow
Update hard rollback callback logic

We previously followed the following logic for callbacks in a hard
rollback:

  - check there's an inflight op, and that it has a callback
  - if this isn't the case, then emit the error

This logic doesn't work very well in the situation where we don't have
an inflight op. This can happen in the following case:

  - I submit an invalid op
  - the op is added to the pending ops queue
  - we attempt to apply the op to the local document before flushing
  - `type.apply` throws, so the op is never flushed from pending to
    inflight
  - we perform a hard rollback
  - we now find we have no inflight op, but we do have a pending op

In this case, since we have no inflight op, we'd emit the error, but
also call the pending op callback, causing both a callback call _and_
an error emission, which is a bit surprising.

This change updates our logic, so that:

  - we check that there are some ops to callback
  - and that all of those ops have callbacks

If there are no callbacks, or if any of the ops don't handle the error,
then we emit, so that we can be sure of never swallowing an error. We
also avoid treating the inflight op any differently to pending ops, so
that we avoid behaviour that's dependent on where in its lifecycle an op
throws.

However, if the client handles all of their op submission errors, then
we never emit.
Pull Request #259: Catch synchronous errors in `Doc._otApply`

1093 of 1311 branches covered (83.37%)

18 of 18 new or added lines in 1 file covered. (100.0%)

2304 of 2410 relevant lines covered (95.6%)

407.65 hits per line

Relevant lines Covered
Build:
Build:
2410 RELEVANT LINES 2304 COVERED LINES
407.65 HITS PER LINE
Source Files on otapply-rollback
  • List 0
  • Changed 15
  • Source Changed 1
  • Coverage Changed 15
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses

Recent builds

Builds Branch Commit Type Ran Committer Via Coverage
926 otapply-rollback Update hard rollback callback logic We previously followed the following logic for callbacks in a hard rollback: - check there's an inflight op, and that it has a callback - if this isn't the case, then emit the error This logic doesn't wor... Pull #259 22 Nov 2018 09:38AM UTC web-flow travis-ci pending completion  
925 otapply-rollback Update hard rollback callback logic We previously followed the following logic for callbacks in a hard rollback: - check there's an inflight op, and that it has a callback - if this isn't the case, then emit the error This logic doesn't wor... push 22 Nov 2018 09:38AM UTC Alec Gibson travis-ci pending completion  
922 otapply-rollback Catch synchronous errors in `Doc._otApply` Fixes https://github.com/share/sharedb/issues/257 As outlined in the above issue, calling `Doc.submitOp` can sometimes `throw` a synchronous error, for example when submitting an invalid op that causes ... Pull #259 16 Nov 2018 02:11PM UTC web-flow travis-ci pending completion  
921 otapply-rollback Catch synchronous errors in `Doc._otApply` Fixes https://github.com/share/sharedb/issues/257 As outlined in the above issue, calling `Doc.submitOp` can sometimes `throw` a synchronous error, for example when submitting an invalid op that causes ... push 16 Nov 2018 02:11PM UTC Alec Gibson travis-ci pending completion  
920 otapply-rollback Catch synchronous errors in `Doc._otApply` Fixes https://github.com/share/sharedb/issues/257 As outlined in the above issue, calling `Doc.submitOp` can sometimes `throw` a synchronous error, for example when submitting an invalid op that causes ... Pull #259 15 Nov 2018 04:03PM UTC web-flow travis-ci pending completion  
919 otapply-rollback Catch synchronous errors in `Doc._otApply` Fixes https://github.com/share/sharedb/issues/257 As outlined in the above issue, calling `Doc.submitOp` can sometimes `throw` a synchronous error, for example when submitting an invalid op that causes ... push 15 Nov 2018 04:03PM UTC Alec Gibson travis-ci pending completion  
918 otapply-rollback Catch synchronous errors in `Doc._otApply` Fixes https://github.com/share/sharedb/issues/257 As outlined in the above issue, calling `Doc.submitOp` can sometimes `throw` a synchronous error, for example when submitting an invalid op that causes ... Pull #259 15 Nov 2018 12:16PM UTC web-flow travis-ci pending completion  
917 otapply-rollback Catch synchronous errors in `Doc._otApply` Fixes https://github.com/share/sharedb/issues/257 As outlined in the above issue, calling `Doc.submitOp` can sometimes `throw` a synchronous error, for example when submitting an invalid op that causes ... push 15 Nov 2018 12:15PM UTC Alec Gibson travis-ci pending completion  
See All Builds (1414)
  • Repo on GitHub
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

© 2025 Coveralls, Inc