fix: initialize missing state vector with 0 for new client

This commit is contained in:
Bartosz Sypytkowski 2024-05-02 08:17:06 +02:00
parent 443335fa73
commit 27299f7746

View File

@ -265,7 +265,10 @@ const integrateStructs = (transaction, store, clientsStructRefs) => {
*/
const updateMissingSv = (client, clock) => {
const mclock = missingSV.get(client)
if (mclock == null || mclock > clock) {
if (mclock === undefined) {
// we never seen that client before
missingSV.set(client, 0)
} else if (mclock > clock) {
missingSV.set(client, clock)
}
}