pycrdt icon indicating copy to clipboard operation
pycrdt copied to clipboard

Add transaction to event slots

Open fcollonval opened this issue 10 months ago • 3 comments

Fixes #232 Fixes #234

Add transaction to event slots.

This ends up a bit more complex to be able to keep a reference to the transaction in the event, this PR introduced a BaseTransaction that only keeps reference to the document and the origin (independently of the rust object). That ensures the introspection of the event at any time.

It also introduces a more robust way to maintain the mapping of Python origin and rust origin.

fcollonval avatar Feb 17 '25 15:02 fcollonval

Thanks for the PR, I will have a look soon.

davidbrochart avatar Feb 19 '25 15:02 davidbrochart

@fcollonval Could you explain the reasoning about adding a reference count to origins?

davidbrochart avatar Feb 20 '25 09:02 davidbrochart

Not using a counter will result in discarding the origin from the mapping too early.

I don't think it's the case if the transaction is dropped after removing the origin from the doc.

davidbrochart avatar Mar 04 '25 10:03 davidbrochart

Closing as no feedback, feel free to reopen.

davidbrochart avatar Jun 16 '25 06:06 davidbrochart