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

share / sharedb / 920
96%
master: 97%

Build:
Build:
LAST BUILD BRANCH: dependabot/github_actions/actions/checkout-6
DEFAULT BRANCH: master
Ran 15 Nov 2018 04:03PM UTC
Jobs 3
Files 24
Run time 1min
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

pending completion
920

Pull #259

travis-ci

web-flow
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 `type.apply` to `throw`.

This is surprising behaviour, because an error handler should already be
provided in the callback supplied to `submitOp`. What's more, the doc
could be left partially mutated and out-of-sync with the server, which
could lead to confusing behaviour.

This change wraps all internal usage of `Doc._otApply` in `try`/`catch`
blocks. If an error is thrown in this method, then we attempt to
recover with `Doc._hardRollback`, which will attempt to reset the
document and then call the callbacks of the pending ops with the error.

This change also prevents `Doc._hardRollback` from emitting an error if
at least one pending op callback was invoked, so that we don't branch
error handling behaviour.
Pull Request #259: Catch synchronous errors in `Doc._otApply`

1090 of 1311 branches covered (83.14%)

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

2300 of 2409 relevant lines covered (95.48%)

404.29 hits per line

Jobs
ID Job ID Ran Files Coverage
1 920.1 15 Nov 2018 04:03PM UTC 0
95.48
Travis Job 920.1
2 920.2 15 Nov 2018 04:03PM UTC 0
95.48
Travis Job 920.2
3 920.3 15 Nov 2018 04:04PM UTC 0
95.48
Travis Job 920.3
Source Files on build 920
  • Tree
  • List 0
  • Changed 15
  • Source Changed 1
  • Coverage Changed 15
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Travis Build #920
  • Pull Request #259
  • PR Base - master (#912)
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