Releases: share/sharedb
Releases · share/sharedb
v1.0.0-beta.20
- #273 - [fix] In
Doc._clearInflightOp
, clearinflightOp
before calling callbacks (@ericyhwang)- Fixes #272, a double-callback issue during chained op submissions, where if the second op is invalid, the first op's callback gets called twice.
[UNPUBLISHED] v1.0.0-beta.19
This version was unpublished from NPM, at 2019-02-15, ~02:30 UTC.
It was causing issues in 'readSnapshots'
middleware for queryPoll()
calls. Single-document fetch and subscribe should not have been affected. See #269 for details.
- #263 - For
readSnapshots
middleware, add request method and parameter info - @ericyhwang- When ShareDB invokes the
readSnapshots
middleware function, the first argument now contains new propertiesmethod
andparameters
. - These can be useful for logging and monitoring of the response sizes for snapshot read requests.
- When ShareDB invokes the
v1.0.0-beta.18
- #262 - Add fetch snapshot by time methods (@alecgibson)
Connection.fetchSnapshotByTimestamp
MilestoneDB.getMilestoneSnapshotAtOrBeforeTime
MilestoneDB.getMilestoneSnapshotAtOrAfterTime
- #264 - Updated example for
<textarea>
(@urbanspr1nter)
v1.0.0-beta.17
- #261 - Fix memory leak in agent when subscribing to stream that already has an active subscription (@dcharbonnier)
v1.0.0-beta.16
#259 - Catch synchronous errors in Doc._otApply
(@alecgibson)
- This also changes the
Doc._hardRollback
error emit behavior - it now emits an error if there was at least one inflight / pending op without a callback, instead of emitting an error if just the inflight op didn't have a callback.
v1.0.0-beta.15
#258 - Allow custom logger overrides (@alecgibson)
- Logger overrides work for both the ShareDB server and client.
- See https://github.com/share/sharedb/tree/v1.0.0-beta.15#logging (server) and https://github.com/share/sharedb/tree/v1.0.0-beta.15#logging-1 (client) for examples.
v1.0.0-beta.14
(Not an actual published release; this is the same code as the previous release v1.0.0-beta.13, just accidentally pushed as a new tag)
v1.0.0-beta.13
More work by @alecgibson on the under-development fetchSnapshot
feature:
- #237 - [feature] Expose
snapshotType
(current
orbyVersion
) inreadSnapshots
middleware, based on whetherfetch
orfetchSnapshot
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 withcb(error, wasSaved)
, and it's now invoked withcb(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.
- This introduces a technically backwards-incompatible change for the arguments passed when invoking the callback to
v1.0.0-beta.12
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 everyinterval
versions by default. - Or don't pass the
interval
option to turn off saving of milestone snapshots by default.
- Pass in the
- For fine-grained control over when to save a milestone snapshot, register middleware on the
'commit'
action and set therequest.saveMilestoneSnapshot
property totrue
orfalse
to explicitly enable or disable milestone snapshot saving on that commit. If the property is left at its default value ofnull
, then the defaultinterval
is used, if that was specified when constructing the MilestoneDB.
v1.0.0-beta.11
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.