Skip to content

Releases: pouchdb/pouchdb

8.0.1

09 Feb 11:14
Compare
Choose a tag to compare

The first release of the year! This is a patch release, it fixes a bug we introduced during a refactor made in the last release and sets Node 14 in our CI. For a full changelog from 8.0.0 to 8.0.1, please see the releases page or view the latest commits.

Fix this of changesHandler

#8583 #8581 We introduced a bug in the #8450 refactor that has been fixed now.

Use Node 14

#8570 We were testing our CI in GHA against Node 12, which is EOL. Now we are testing against Node 14.

Changelog

Bugfixes

Documentation

  • 4dcaac82 docs: release post for 8.0.0
  • 0bdb3423 feat: add mastodon verification link
  • 40ac7a26 feat(site): faster website uploads, rsync skips files that are already on the server
  • ae69d4fb fix(blog): title case
  • 3728f020 Update 2022-12-14-pouchdb-8.0.0.md
  • c90a0208 Update 2022-12-14-pouchdb-8.0.0.md
  • e9bf059c docs: update to version 8.0.0
  • 7484e245 docs: update 2022-12-14-pouchdb-8.0.0.md

Testing

Get in touch

As always, we welcome feedback from the community. Please don't hesitate to file issues, open discussions or get in touch. And of course, a big thanks to all of our new and existing contributors!

8.0.0

15 Dec 11:55
Compare
Choose a tag to compare

We are thrilled to announce the release of PouchDB's new major version 8.0.0. For a full changelog from 7.3.1 to 8.0.0, please see the releases page or view the latest commits. Here are the highlights:

Embracing modern ES6+ JS syntax

We have started the process of moving to ES6+ syntax. We made refactors to use native JS classes instead of prototypes, deprecated some packages that implemented features that are now built in the language (inherits, argsarray), and started in packages such as pouchdb-abstract-mapreduce and pouchdb-adapter-http. We encourage you to embrace the syntax in your new contributions and, if you can, contribute to the refactoring effort.

This might mean a potentially breaking change, therefore we bump the major version. If you need to support ES5 we recommend you use a transpiler.

Add activeTasks

#8422 #8441 Analogous to the _active_tasks feature in CouchDB, PouchDB now has activeTasks. With this functionality, PouchDB is able to list all active database tasks, like database_compaction, view_indexing, or replication. PouchDB will report the progress of these tasks to the active tasks API and remove tasks as soon as they are completed or have failed.

Example usage:

let tasks = PouchDB.activeTasks.list()

Example result:

[{
  "id": "d81fea92-8ce4-42df-bb2b-89a4e67536c3",
  "name": "database_compaction",
  "created_at": "2022-02-08T15:38:45.318Z",
  "total_items": 12,
  "completed_items": 1,
  "updated_at": "2022-02-08T15:38:45.821Z"
}]

Add purge to the indexeddb adapter

#8453 Similar to CouchDB's purge, PouchDB has now purge for its indexeddb adapter.

Purge permanently removes data from the database. Normal deletion with db.remove() does not, it only marks the document as _deleted=true and creates a new revision. This behaviour ensures that deletes can be replicated across databases, and deleted documents don’t get undeleted by syncing with a database that still has this document.

db.purge() is not intended as a regular method for deleting documents, instead, it is meant as an admin function for cases where some secret was erroneously added to the database and must now be removed completely, eg. a credit card or social security number. Purge effectively puts the database in a state where the offending write never happened.

Example usage:

try {
  const result = await db.purge('mydoc', '6-3a24009a9525bde9e4bfa8a99046b00d');
  // handle result
} catch (error) {
  // handle error
}

Example result:

{
  "ok": true,
  "deletedRevs": [
    "6-3a24009a9525bde9e4bfa8a99046b00d",
    "5-df4a81cd21c75c71974d96e88a68fc2f"
  ],
  "documentWasRemovedCompletely": false
}

Changelog

New features

  • 0680c0ac feat(core): simple active tasks implementation
  • c3fc43cc feat: use activeTasks error handling
  • 9a83c11f feat(core): activeTasks remove reason argument
  • 40dc6b37 feat(replicate): track live replications in activeTasks
  • f5b6d35e feat(core): view indexing use activeTasks API
  • d784b49a feat(replicate): replication uses activeTasks API
  • 52a52495 feat: database compaction use activeTasks API
  • ed0db363 feat(core): make activeTasks.list() return array
  • eaf9d52f feat(core): active tasks created_at/updated_at naming
  • 544eb77d feat(purge): add purge to core
  • ec1b7872 chore(purge): remove only from purge tests
  • 3445a012 feat(indexeddb): proof-of-concept purge method
  • e861d00f wip(indexeddb): stub _purgeRev method
  • 972ae331 wip(merge): findPathToLeaf, removeLeafFromTree
  • 4e921ebd feat(merge): removeLeafFromTree return empty trees
  • 3e3f7613 feat: make purge delete docs if tree is empty
  • a8b5e00c feat(indexeddb): attachment purging
  • 693ea5c1 feat(purge): handle missing doc, return something
  • 774976a0 feat: on-update view purging
  • 94ec8932 feat(core): purged_infos_limit support
  • ce8f8b30 [wip] Purge leaves from multiple roots
  • 4252a0f0 docs(purge): show result object seperately
  • b856173b chore(purge): add code comments
  • d5f4250a chore(purge): remove unneeded logs and comments
  • 2c0ddbb0 feat(purge): simplify implementation of removeLeafFromTree()

Bugfixes

  • 34a79749 fix: check replication currentBatch
  • 8f33ff0a fix: add activeTask stub to mock replication database
  • 3fe71b03 (#8491) - Fix $regex and $ne within $or operator
  • 86ccf481 fix(core): active tasks object datastructure
  • 5f61b1fe fix partial filter find on indexeddb adapter
  • 759ea5a0 fix: store partial_filter_selector in ddocs
  • 9519c748 fix: active tasks race condition
  • 25a12e11 fix(merge): removeLeafFromTree to properly use branchings
  • d5f29f7b fix(indexeddb): rev purging typo
  • f0958b50 fix(purge): use callback in adapter
  • b20139e1 fix(core): purge error values
  • 4d11ef51 fix(a-m-r): purge check return value
  • 203ae670 fix: remove logging
  • 24157fcf (#8513) - Race condition for pouchdb hanging indefinitely when multiple instances are used
  • 15092e8e chore: catch selenium errors earlier
  • 2eca392b fix: (#8471) filterInclusiveStart for nested fields
  • 45dc5ae8 Fix the implementation of _bulkDocs() in the http adapter without using adapterFun()
  • fcb71db4 fix: active task total items calculation (#8508)
  • 76d35e44 fix: replication cancellation race condition (#8507)

Documentation

  • 7c6753a6 Mark a few words in the 7.3 post as code so t...
Read more

7.3.1

11 Nov 15:10
Compare
Choose a tag to compare

We're happy to announce the release of PouchDB 7.3.1, bringing in some fixes and dependency updates. For a full changelog from 7.3.0 to 7.3.1, please see the releases page or view the latest commits. Some of the highlights:

Changelog

Bugfixes

  • 7db104c5 (#8463) - check if docFieldValue is also null value. typeof null returns object in javasctipy. Fixes a bug when querying against and array with a null value, $elemMatch and $allMatch.
  • 719502dc (#8225) - Added check for blob.type setter
  • d5bb7bd6 (#8389) - _id was mappped to data._id instead of id
  • bbeb7e55 (#8531) - fix sorted find including deleted docs

Testing

Dependency updates

  • 922f7b54 (#8470) - fix: upgrade promise-polyfill from 8.2.0 to 8.2.3

Other changes

  • fa57c294 (#8468) Replace deprecated String.prototype.substr()
  • 5a52f2ce (#8343) - Add contextual data to the error message of failing tryMap and tryReduce

Get in touch

As always, we welcome feedback from the community and would love to hear what you think of this release as well as PouchDB's future direction. Please don't hesitate to file issues, open discussions or get in touch. And of course, a big thanks to all of our new and existing contributors!

7.3.0

14 Apr 07:16
Compare
Choose a tag to compare

We're happy to announce the release of PouchDB 7.3.0, bringing in features, fixes and dependency updates. For a full changelog from 7.2.2 to 7.3.0, please see the releases page or view the latest commits. Some of the highlights:

Improving testing

We have been investing lots of time into our test suites, with around 36 commits, 112 files changed, 3314 insertions and 2064 deletions made about this topic. We have:

  • Migrated from Travis CI to Github Actions, which has improved the speed, throughput and reliability of our CI.
  • Rewrote TESTING.md documentation.
  • Upgraded eslint configuration in order to use ES6 syntax within our tests. Feel free to incorporate newer syntax (such as async/await) into your new tests contributions.
  • Fixed bugs in CI configuration: ADAPTERS and GREP variables weren't working correctly, background servers being started incorrectly, build failure caused by an older version of pouchdb-express-router.
  • Unified the configuration variables used in the build.
  • Fix the majority of non-deterministic tests to substantially reduce random failure during CI runs, and put in tooling for retrying failed tasks. This includes improving tests that check behaviour for unreachable servers, which previously relied on a third party service being available.
  • Restructured the CI tasks so that each task exercises a single backend (i.e. CouchDB server version or client-side PouchDB adapter), rather than some combination of local and remote adapters. This reduces the impact of flaky tests, reduces the duration of each task, reduces redundant tasks repeating the same work, and allows more parallelisation of tests.
  • Improved the test coverage across target platforms, including cross-browser tests, different Node.js versions, and different CouchDB versions. We have fixed tests that assume CouchDB v1.x behaviour so that they now work on v2.x and v3.x.
  • Allowed the indexeddb adapter to be loaded and used during tests

Add indexeddb adapter in the default distribution

The indexeddb adapter is now available in the default distribution. You can use it specifying the adapter:

PouchDB.plugin(require('pouchdb-adapter-indexeddb'));
const db = new PouchDB('mydb', {adapter: 'indexeddb'});

Please note that it is considered BETA quality, use it carefully and please report any issues you find. Thank you.

Add view_update_changes_batch_size

#8320 With view_update_changes_batch_size, we can now specify how many change records will be consumed at a time when rebuilding view indexes when the query() method is used.

Support partial_filter_selector

#8276 #8277 Now PouchDB-find supports partial_filter_selector.

Indexing event to show the progress of view updates

#8321 We can now subscribe to an indexing event, which will emit a progress object containing the properties view, last_seq, results_count and indexed_docs.

Checkpoint events during replication

#8324 During replication, we can subscribe to checkpoint events, which will emit the following properties: checkpoint, revs_diff, start_next_batch and pending_batch.

Add style to replication options

#8380 #8379 We expose changes feed style to replication options.

Add view_adapter option

#8335 view_adapter provides an option for the user to specify a separate adapter to store their view index in addition to the main adapter for their core data:

const db = new PouchDB(DB_NAME, {adapter: 'idb', view_adapter: 'memory'});

Enable discussions and projects

In Github we have enabled:

  • Discussions: feel free to open and participate
  • Projects: we are keeping track of the issues and PRs for future releases.

Changelog

New features

  • 7cc1c8e3 (#8171) - Allow _access field in documents
  • b359d788 Let caller set the change batch size when updating views (#8320)
  • a9e2996b (#8277) - Support partial_filter_selector
  • 0875b19a Add an indexing event to show progress of view updates
  • fe9bd028 Add checkpoint events during replication
  • b523a1d2 (#8379) - Expose changes feed style to replication options (#8380)
  • (#8335) Add view adapter option

Bugfixes

  • b8d3fc65 (#8229) - indexeddb: ensure errors are propagated and handle database deletion
  • fe7ffa9c (#8237) - Conform pouchdb find operators to couchdb's (#8327)
  • 0e27e23f (#8222) - fix multiple $regex conditions on same field when using $and
  • ab451d9e (#8165) - Initial dollar sign escaped with unit tests.
  • f544c822 (#8242) - unhandled promise rejection in upsert
  • 62dd11bf (#8185) - Fix date checking
  • a6a34357 (#8187) - Don't include leveldown in browsers
  • 9bf13109 (#7331) - Close leveldb file handlers
  • be55391b (#8274) - rev() should clone only when needed
  • 8377ae00 (#8316) - Properly handle transaction abort
  • c4aaf255 Fix escaping of key path segments in indexeddb adapter (#8358)
  • 77d9782a Fix memory leak when replications fails
  • 73a9bad4 fix: add auto_compaction to indexeddb bulkDocs
  • (#8460) Fix writing erroneous attachment rev references in bulkDocs
  • (#8370) Implement skip and limit for keys query #8404
  • (#8473) Add stack to CustomPouchError (fix #8372)
  • (#8473) Add idb global database failure error as reason to transaction errors #8414

Documentation

Read more

7.2.2

27 Jul 12:48
Compare
Choose a tag to compare
build 7.2.2

7.2.1

16 Feb 23:01
Compare
Choose a tag to compare

New indexeddb adapter

#7618 - We are excited to announce the release of a new adapter for indexeddb access which uses native indexes rather than custom tables. This is an additional adapter rather than an upgrade so you can continue using "idb" for the old version or choose to switch to "indexeddb". The new version is not backwards compatible and data migration is left as an exercise for the reader.

Other changes

For a full changelog from 7.1.1 to 7.2.1, please see the releases page or view the latest commits.

Get in touch

As always, we welcome feedback from the community and would love to hear what you think of this release as well as PouchDB's future direction. Please don't hesitate to file issues or get in touch. And of course, a big thanks to all of our new and existing contributors!

NB: There was an issue while publishing which broke the 7.2.0 release - use this release instead.

7.1.1

14 Jun 04:59
Compare
Choose a tag to compare

we have another PouchDB release. The main improvements in this release are bug fixes and dependency updates.
For a full changelog from 7.0 to 7.1.0, please see the releases page or view the latest commits.

Get in touch

As always, we welcome feedback from the community and would love to hear what you think of this release as well as PouchDB's future direction. Please don't hesitate to file issues or get in touch. And of course, a big thanks to all of our new and existing contributors!

If you wondering where is 7.1.0, I had a slight publishing issue so the easiest was to bump it up to 7.1.1 to do a fresh deploy.

7.0.0

21 Jun 11:08
Compare
Choose a tag to compare

As promised back in January it is time to drop WebSQL from our default builds. This not only lets us focus our development efforts on a single engine but along with the other changes explained below reduces the default PouchDB package size from 148KB to 122KB, thats 17.5% smaller!

Removed WebSQL

#6943 - The WebSQL adapter is still available to download and use, it will no longer be available as part of a default PouchDB build and will eventually be moved to the pouchdb-community repo. If you need to migrate your users from WebSQL to IndexeDB then there is some advice available in our previous release post.

Removed Promise Polyfill

#6945 - Including our own Promise polyfill means larger bundles when most apps already include their own polyfill if they need it. So if you support browsers which do not support Promises natively you will need to include a polyfill yourself. We use promise-polyfill and have found it to work great.

Switch to fetch

#6944 - This is another API that may need polyfilled if you use PouchDB and support IE, we use whatwg-fetch. Switching to fetch has allowed us to expose the ability to intercept the requests PouchDB makes for more flexibility, such as:

var db = new PouchDB('http://example.com/dbname', {
  fetch: function (url, opts) {
    opts.headers.set('X-Some-Special-Header', 'foo');
    return PouchDB.fetch(url, opts);
  }
});

That will add a X-Some-Special-Header to every HTTP request PouchDB makes.

Deterministic Revisions

#4642 - We now match CouchDB default behaviour and use the documents contents to determine its revision, this means automated conflict resolution handlers are less likely to generate extra conflicts.

More Deprecations

  • #6946 - Remove debug dep
  • #7134 - Remove IndexedDB storage option
  • #6944 - Remove deprecated skipSetup

Fixes

  • #7040 - Use fixed-length array in idb/indexeddb allDocs
  • #6655 - Use consistent types for replication progress values
  • #7085 - Accept old Safari version as valid
  • #7095 - Reduce replication to server requests
  • #7115 - Remove catastrophic backtracking vulnerability
  • #7127 - Fix docs for db.query()'s options.reduce default
  • #7141 - Fix ios idb blobSupport silent fail
  • #6502 - Set return_docs default false when opts.live = true
  • #7216 - Check level.destroy exists before calling
  • #5814 - Ensure prefix has trailing slash

Get in touch

As always, we welcome feedback from the community and would love to hear what you think of this release as well as PouchDB's future direction. Please don't hesitate to file issues or get in touch. And of course, a big thanks to all of our new and existing contributors!

6.4.3

02 Feb 12:50
Compare
Choose a tag to compare
build 6.4.3

6.4.2

24 Jan 12:32
Compare
Choose a tag to compare

In this release PouchDB now supports IndexedDB by default in Safari and will drop support for WebSQL in future versions.

A brief history of WebSQL

Just over 5 years ago PouchDB got its first support for WebSQL, originally to support Opera WebSQL was able to pick up for the lack of support for IndexedDB in Safari and gave PouchDB the ability to support a wide variety of browsers. Opera gained IndexedDB support from its switch to Blink / Chromium and with WebSQL failing to become a web standard Safari started supporting IndexedDB from its 7.1 release. Initially there were too many bugs in Safari's implementation for PouchDB to use it however after a lot of work from the WebKit devs and a few releases IndexedDB support became stable in Safari and as of this release is now the default storage engine for PouchDB in Safari.

Switching to IndexedDB vastly reduces the amount of work we need to do to keep PouchDB stable, any new features and improvements relating to storage up until now has meant duplicating the entire code and effort for WebSQL, we will also see a nice reduction in the bundle size.

Migrating current users

If you are using PouchDB and expect to want to use new releases then you will need to
migrate your current users, this release of PouchDB supports both WebSQL and IndexedDB
in Safari so one solution that may work depending on your circumstances is to
replicate between them like so:

function openDB(name, opts) {
  return new Promise(function(resolve, reject) {
    var localdb = new PouchDB(name, opts);
    localdb.info().then(function(info) {

      if (info.adapter !== 'websql') {
        return resolve(localdb);
      }

      var newopts = opts || {};
      newopts.adapter = 'idb';

      var newdb = new PouchDB(name, opts);
      var replicate = localdb.replicate.to(newdb);
      replicate.then(function() {
        resolve(newdb);
      }).catch(reject);
    }).catch(reject);
  });
}

More Deprecations

With PouchDB we aim to keep breaking changes to a minimum which means when we do have a
breaking change release like the upcoming 7.0 there will usually be a few other changes.
Currently it looks likely that we will remove our Promise Polyfill and switch to the fetch API for HTTP requests. These arent all certain and you can follow along or join in with the 7.0 release discussion here.

Other Changes

  • #7019 - Dont crash on empty HTTP requests
  • #7008 - Add Glitch bug helper
  • #6954 - Fix hang when storage quota is exceeded
  • #6958 - Fix PouchDB find with zero values
  • #6971 - Fix allDocs keys and limit < keys.length

Get in touch

As always, we welcome feedback from the community and would love to hear what you think of this release as well as PouchDB's future direction. Please don't hesitate to file issues or get in touch. And of course, a big thanks to all of our new and existing contributors!