Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(iroh): do not double-close docs on drop (#2383)
## Description We unconditionally sent a `DocClose` RPC message when dropping a `iroh::client::docs::Doc` struct. However, we should only ever send a `DocClose` *once* for each doc instance, because otherwise the reference counter in the backend will decrease *twice*, and thus closing the resource in the backend too soon, affecting other open client instances. This was either an oversight or got lost in refactorings, not sure anymore. In any case: This PR fixes the behavior, and also adds a test that fails without this fix. Fixes #2381 ## Breaking Changes <!-- Optional, if there are any breaking changes document them, including how to migrate older code. --> ## Notes & open questions <!-- Any notes, remarks or open questions you have to make about the PR. --> ## Change checklist - [x] Self-review. - [ ] ~~Documentation updates if relevant.~~ - [x] Tests if relevant. - [x] All breaking changes documented.
- Loading branch information