y-crdt / ydotnet

.NET bindings for yrs.
MIT License
35 stars 9 forks source link

Fix TODO comments throughout the solution #23

Open LSViana opened 1 year ago

LSViana commented 1 year ago

This list is not final and will be accumulated as items are solved:

SebastianStehle commented 1 month ago

@LSViana We have this TODO in the code:


    // TODO This is a temporary solution to track the amount of transactions a document has open.
    // It's fragile because a cloned instance of the same document won't be synchronized and if a `Transaction`
    // is opened in the cloned instance, it'll receive `null` from the Rust side and will cause the
    // `ThrowHelper.PendingTransaction()` to run (which is acceptable since it's a managed exception).
    internal void NotifyTransactionStarted()
    {
        openTransactions++;
    }

    internal void NotifyTransactionClosed()
    {
        openTransactions--;
    }
Do you think we will ever have a final solution or shall we just remove this and also close this issue?
LSViana commented 1 month ago

@SebastianStehle I think we'll have some solutions if we ever look into that in detail but I didn't do it yet.

Given that, I'd just leave it there. It's not harmful and informs other developers who read the same code which is a positive detail.