appendChange appends a copy of the change, keeping the log ordered by
clientSeq.
load returns a deep copy of the persisted entry, or undefined.
remove deletes everything persisted for the document key.
saveMeta stores a copy of the header, leaving the snapshot and the log
untouched.
saveSnapshot stores a copy of the bytes and clears the change log.
MemoryDocStoreis an in-memoryDocStore. It holds entries in aMapfor the lifetime of the process and carries no external dependency. It is the default when a durable backend is not configured, and it doubles as a test double for the persistence loop.Every byte array is copied on the way in and on the way out, so neither a caller mutating what it wrote nor one mutating what it read can corrupt the stored entry.