Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lib/agent.js
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,9 @@ function getSnapshotData(snapshot) {
v: snapshot.v,
data: snapshot.data
};
if (snapshot.m) {
data.m = snapshot.m;
}
if (types.defaultType !== types.map[snapshot.type]) {
data.type = snapshot.type;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/backend.js
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ Backend.prototype.subscribe = function(agent, index, id, version, options, callb
if (version == null) {
// Subscribing from null means that the agent doesn't have a document
// and needs to fetch it as well as subscribing
backend.fetch(agent, index, id, function(err, snapshot) {
backend.fetch(agent, index, id, {snapshotOptions: {metadata: true}}, function(err, snapshot) {
if (err) {
stream.destroy();
return callback(err);
Expand Down
3 changes: 3 additions & 0 deletions lib/client/doc.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,9 @@ Doc.prototype.ingestSnapshot = function(snapshot, callback) {
this.data = (this.type && this.type.deserialize) ?
this.type.deserialize(snapshot.data) :
snapshot.data;
if (snapshot.m) {
this.meta = snapshot.m;
}
this.emit('load');
callback && callback();
};
Expand Down