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
The hashed_origin obtained is not the one stored in the __init__, how could you be sure you are not removing a reference to another hash?
You mean the hashed origin obtained in __exit__? If so, yes it is the one stored in __enter__, previously computed and registered in __init__. Am I missing something?
The resource clearing is not happening in the mirror action of its creation; aka init <=> del
A transaction should only be used with a context manager, so registering an origin in __init__ is equivalent to registering it in __enter__, which is symmetrical to the clearing happening in __exit__.
But I agree that users could create the Transaction object and never use it in a context manager, for whatever reason. Moving the registering to __enter__ should handle that case, right? I guess that's also what you meant by:
You cannot be sure the transaction will be discarded at exit.
I find the cleaning of the origin too brittle:
pycrdt/python/pycrdt/_transaction.py
Line 80 in 181c192
Reasons:
__init__
, how could you be sure you are not removing a reference to another hash?The text was updated successfully, but these errors were encountered: