Skip to content

Releases: share/sharedb

v1.0.0-beta.13

05 Sep 20:52

Choose a tag to compare

More work by @alecgibson on the under-development fetchSnapshot feature:

  • #237 - [feature] Expose snapshotType (current or byVersion) in readSnapshots middleware, based on whether fetch or fetchSnapshot is being called.
  • #242 - [bugfix] Close milestone database when calling Backend.close.
  • #244 - [refactor] Add a NoOpMilestoneDB implementation, used as default MilestoneDB
    • This introduces a technically backwards-incompatible change for the arguments passed when invoking the callback to MilestoneDB::saveMilestoneSnapshot. The callback was invoked with cb(error, wasSaved), and it's now invoked with cb(error).
    • This shouldn't affect any existing code, as the previous default implementation did not save milestone snapshots, and there are no actual implementations published.

v1.0.0-beta.12

17 Aug 21:16

Choose a tag to compare

Changes

  • #236 - Add milestone snapshots, which are persisted snapshots of documents at previous versions, used to speed up Backend#fetchSnapshot. (@alecgibson)

About MilestoneDB

This adds a new MilestoneDB class, which handles persisting milestone snapshots, with a default no-op base implementation. Methods:

  • MilestoneDB.getMilestoneSnapshot(collection, id, version, callback): void
  • MilestoneDB.saveMilestoneSnapshot(collection, snapshot, callback): void

To persist milestone snapshots:

  • Pass in a real implementation of MilestoneDB (to come later) when constructing Backend: new Backend({milestoneDb})
  • When constructing a real MilestoneDB, decide whether to save milestone snapshots by default for all collections:
    • Pass in the interval option to save milestone snapshots every interval versions by default.
    • Or don't pass the interval option to turn off saving of milestone snapshots by default.
  • For fine-grained control over when to save a milestone snapshot, register middleware on the 'commit' action and set the request.saveMilestoneSnapshot property to true or false to explicitly enable or disable milestone snapshot saving on that commit. If the property is left at its default value of null, then the default interval is used, if that was specified when constructing the MilestoneDB.

v1.0.0-beta.11

13 Aug 18:49

Choose a tag to compare

Changes

  • #220 - Add connection.fetchSnapshot(collection, id, version, callback): void method, for fetching a snapshot at a particular version. (@alecgibson)
    • See the README for more API documentation.
    • Performance note: This method could be slow if requesting a very large version number. ShareDB only stores the most recent snapshot, so this method internally fetches all ops up to the requested version and applies each op in sequence to get the snapshot.

v1.0.0-beta.10

01 Aug 22:33

Choose a tag to compare

Changes

  • #217 - Allow ops received by the server to be non-objects, for consistency with client (@gkubisa)
  • #204 - Fix memory leak where Doc.destroy leaves around a stub object (@gkubisa)
  • #228 - Log warning when using deprecated middleware actions "doc" and "after submit" (@gkubisa)

Tests

  • #226 - Update to Mocha 5 (@gkubisa)
  • #227 - Fix flaky maxSubmitRetries test (@alecgibson)
  • #230 - Remove devDependency on sharedb-mingo-memory, breaking a circular dependency when developing in share/sharedb (@ericyhwang)

Documentation