Y.applyUpdate() is doing anything

I am using Y.applyUpdate() for a complex json data but it’s not working sometimes.

// Client Side
const doc = new Y.Doc();
const stateVector1 = Y.encodeStateVector(doc);
let ymapJSON = doc.getMap(‘json’);
doc.transact(() => {
ymapJSON.set(‘data’, designer.data);
}, uniqueId);

    const diff1 = Y.encodeStateAsUpdate(doc, stateVector1);
    currentSocket.emit('update', {update: diff1, Id: id});
    
    //Server Side
     socket.on('update', async ({update, Id}) => {
    	// doc is defined earlier while I loaded the presentation the first time
    const ymap = doc.getMap('json');
    doc.transact(() => {
      Y.applyUpdate(doc, update,);
    });
    let updatedJson = ymap.get('data');
    await redis.set(redis_key, JSON.stringify(data))
    })}

Please put a little bit more care in your future posts. I really can’t help you like this.

The (fairly complex) example is not reproducible, badly formatted, and I don’t understand what you want to achieve.