You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Detailed documentation/test missing for ingestSnapshot #254
Currently there are no tests that invoke ingestSnapshot directly.
Such tests would be useful in documenting exactly how one could go about using ingestSnapshot, which is IMO not clear from the current documentation. For example, after reading "This data must include a version, snapshot and type.", I'm still not sure what to pass in exactly. I'd guess an object with properties version, snapshot and type, but still not sure what kinds of values would be expected.
I've updated the README in a67ad42 to clarify the format for the param.
Any additional clarifications on the documentation that you'd like?
Re the tests, ingestSnapshot gets covered indirectly by doc fetch/subscribe. As you say, it could be useful to have a simple test as "enforced" documentation. If you want to add one, that'd be great!
Activity
[-]Test for ingestSnapshot[/-][+]Detailed documentation/test missing for ingestSnapshot[/+]curran commentedon Nov 5, 2018
In particular, I had difficulty finding out how to construct a
snapshotfrom a fetched ShareDB.Doc.I eventually did get it to work, and here's the solution:
This may be a good example to put in the README.
Clarify README for `doc.ingestSnapshot(snapshot, callback)`
ericyhwang commentedon Nov 6, 2018
Yup, the documentation isn't as precise as it could be. The JSDoc for
ingestSnapshotis clearer - it says it requiresv,data, andtypefields on thesnapshotparam.https://github.com/share/sharedb/blob/v1.0.0-beta.14/lib/client/doc.js#L150
I've updated the README in a67ad42 to clarify the format for the param.
Any additional clarifications on the documentation that you'd like?
Re the tests,
ingestSnapshotgets covered indirectly by doc fetch/subscribe. As you say, it could be useful to have a simple test as "enforced" documentation. If you want to add one, that'd be great!curran commentedon Nov 6, 2018
Thanks a ton @ericyhwang for making that update!
curran commentedon Nov 6, 2018
Closing as the update is IMO suffucient.
Clarify README for `doc.ingestSnapshot(snapshot, callback)`
Clarify README for `doc.ingestSnapshot(snapshot, callback)`