Closed satoren closed 3 months ago
The changes involve significant enhancements to transaction management across various modules in the Yex
system. Key updates include the addition of transaction parameters to multiple functions, the introduction of new private functions for streamlined transaction handling, and modifications to existing function signatures to operate within a transactional context. These adjustments improve error handling and concurrency, fostering a more robust and maintainable codebase.
Files | Change Summary |
---|---|
lib/doc.ex , lib/nif.ex , lib/shared_type/array.ex , lib/shared_type/map.ex , lib/shared_type/text.ex , lib/shared_type/xml_element.ex , lib/shared_type/xml_fragment.ex , lib/shared_type/xml_text.ex , lib/y_ex.ex |
Introduced transaction parameters to functions, added new private functions for transaction handling, and modified function signatures for improved transaction management. |
native/yex/Cargo.toml , native/yex/src/array.rs , native/yex/src/awareness.rs , native/yex/src/doc.rs , native/yex/src/map.rs , native/yex/src/subscription.rs |
Enhanced transaction handling by adding current_transaction parameters, transitioning to Mutex for shared access, and integrating transaction context into various functions. |
test/doc_test.exs |
Updated the expected error type in Yex.DocTest from ErlangError to RuntimeError during transaction assertions. |
sequenceDiagram
participant User
participant Doc
participant Nif
participant Transaction
User->>Doc: initiate transaction(origin)
Doc->>Transaction: check for existing transaction
alt no existing transaction
Transaction-->>Doc: begin new transaction
Doc->>Nif: perform operations with cur_txn
Nif-->>Doc: return results
Doc->>Transaction: commit transaction
else existing transaction
Doc-->>User: raise error (RuntimeError)
end
🐰 In fields of green, where bunnies play,
New changes hop in, brightening the day!
Transactions now dance in the code's gentle flow,
Withcur_txn
guiding where data should go.
Hooray for the tweaks that make things so neat,
Let's celebrate coding, oh what a treat! 🌼
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
@coderabbitai review
Summary by CodeRabbit
New Features
:doc
field in several data structures to maintain references to associated documents.Bug Fixes
Documentation
Chores