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
If you pass a context (or transactionOrigin) to the transact method of DirectConnection, the context is not applied to the modifications you perform within your transaction function. So if you have, for instance, onChange hooks in your server extensions, they will not see the given context.
As a workaround, one can of course do something like
directConnection.transact((document)=>{document.transact((document)=>{// Perform actual transaction here},myContext)},myContext)
... but to me this seems unnecessary, as it would seem intuitive for the DirectConnection to take care of this. Maybe, on this line one could instead do
Description
If you pass a
context
(ortransactionOrigin
) to thetransact
method of DirectConnection, the context is not applied to the modifications you perform within your transaction function. So if you have, for instance, onChange hooks in your server extensions, they will not see the givencontext
.As a workaround, one can of course do something like
... but to me this seems unnecessary, as it would seem intuitive for the DirectConnection to take care of this. Maybe, on this line one could instead do
This way, I suppose, it would work as one expect. Let me know what you think.
And thanks for HocusPocus! It generally seems like a great backend for Y.js applications and has pretty good documentation.
The text was updated successfully, but these errors were encountered: