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

pouchdb / pouchdb / 8716
100%

Build:
DEFAULT BRANCH: master
Ran 17 Nov 2016 05:47PM UTC
Jobs 1
Files 1
Run time 1s
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
8716

push

travis-ci

daleharvey
(#4868) - Fix destroy + close events on multiple db's

* ensure `close()` doesn't block `destroyed` events

* chore(fix-test): destroy the database when testing for destruction

* chore(fix-test): serialize call to close()/destroy() in test

* fix(on-closed): keep notifying of destroyed database after close

The final fix for #4868 was a bit more aggressive than the one originally designed, but was also wrong.
This correction only removes the listener for the local database (the one being closed), while the test ensures correctness.

* fix(destruct-listeners): prevent race conditions

This fix allows `close()` to actively destroy the destructListeners array even if the events are out-of-sync.
It also moves all the magic of dealing with the destruct listeners arrays into `setup.js` and provides APIs for the events that may deal with it.
(I'm not 100% sure providing an event API rather than plain `.ref()` and `.unref()` functions is the best way to do this; nice thing is that it allows to listen on those events as well which might be useful to test suites?)

Notice that `destructiListeners` now stores PouchDB instances rather than closures.

Tests were added to try to catch possible mistakes.

* fix(lazy-map.delete): make sure to retrieve the list

`LazyMap.delete` returns a boolean, not the element that got removed.

* fix(constructor-destroyed): use published API

Not sure why I modified the API, but in any case it's published (and there's no need to go beyond the one that's published anyhow).

* fix(constructor-destroyed): prevent flooding from the instances

Since the API is public it's better to not flood back with events.

* chore(camelcase): db_list -> dbList

* chore(test): add tests for coverage

* chore(test): rename test label

* chore(test): skip hard-to-replicate async tests

I suspect the behavior of these tests depends on the version of Node.js used.

* refactor(test): leave existing test in same location

Less diff noise.

* chore(coverage): correct tests and source to achieve coverage

Leaving the two lines out for coverage for now.
I suspect this is due to other issues, I'll return to this in a separate ticket.

* refactor(test): make eslint happy

4648 of 4648 relevant lines covered (100.0%)

26697.61 hits per line

Jobs
ID Job ID Ran Files Coverage
37 8716.37 (COMMAND=report-coverage COVERAGE=1) 17 Nov 2016 05:47PM UTC 0
100.0
Travis Job 8716.37
Source Files on build 8716
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #8716
  • d06752e9 on github
  • Prev Build on master (#8692)
  • Next Build on master (#8731)
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