How to get Transaction Provider

I’m making canvas collaboration tools like figma. Is there a way to distinguish the provider that caused the transaction?

We need a way to figure out who’s moving the canvas elements.

You can specify an optional origin parameter that is stored on transaction.origin and on('update', (update, origin) => ...)

See: doc.transact

I know. But I’m using a web socket, and when another user controls the canvas, the transaction.origin points to the web socket.

Wow, you’re right. That seems wrong to me. Maybe an oversight in the Websocket implementation? It ought to pass the origin all the way through.

1 Like

I am using a y-websocket that is not customized. Isn’t there any way at the moment?

The origin will generally point to the provider of the current client, so if you want to track the remote origin you’ll have to do that separately.