Closed satoren closed 1 month ago
The pull request introduces several modifications across multiple modules, primarily focusing on enhancing the handling of the origin
parameter in various functions. Key changes include updates to the transaction
function in the Yex.Doc
module to accept an origin
parameter, adjustments in the handle_info
functions in Yex.Managed.SharedDoc
, and modifications to the awareness
functions in the Yex.Awareness
module. Additionally, utility functions for converting between Origin
types and terms are introduced in a new utils
module. Test cases are also expanded to ensure proper functionality with the new parameters.
File | Change Summary |
---|---|
lib/doc.ex | Updated transaction function to include an origin parameter; modified implementation to use origin . |
lib/managed/shared_doc.ex | Adjusted handle_info functions to pass from directly instead of using inspect(from) . |
lib/managed/shared_doc_supervisor.ex | Changed argument in monitor/1 to pass self() instead of inspect(self()) . |
lib/protocols/awareness.ex | Updated apply_update function to change origin parameter type from String.t() | nil to term() | nil . |
lib/protocols/shared_doc.ex | Altered message handling to pass from directly; updated broadcast_to_users to compare pid directly. |
native/yex/src/awareness.rs | Changed origin type in awareness_apply_update_v1 from Option<&str> to Term<'_> ; introduced utility functions. |
native/yex/src/doc.rs | Modified doc_begin_transaction to accept Term<'_> for origin instead of Option<&str> . |
native/yex/src/lib.rs | Added a new module utils . |
native/yex/src/utils.rs | Introduced origin_to_term and term_to_origin_binary functions for handling conversions. |
test/doc_test.exs | Added test for Doc.transaction/3 to check various types for origin . |
test/managed/shared_doc_supervisor_test.exs | Changed argument in receive_and_handle_reply_with_timeout to pass proc directly; added persistence test. |
test/managed/shared_doc_test.exs | Simplified argument handling in receive_and_handle_reply_with_timeout/2 ; removed redundant setup. |
test/protocols/shared_doc_test.exs | Updated receive_and_handle_reply_with_timeout/2 to pass proc directly; no new tests added. |
origin
variable in the NifDoc
struct, related to updates in the transaction
function.origin
parameter in the apply_update
function of the Yex.Awareness
module, aligning with the main PR's focus.handle_yjs_message
to include the from
parameter, relating to the handling of origins in message processing.🐇 In the meadow, changes bloom,
With origins to chase away gloom.
Transactions now hold a tale,
From every type, they will prevail.
With tests to guard, we hop and play,
Enhancing code in a joyful way! 🌼
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?
Summary by CodeRabbit
Release Notes
New Features
Bug Fixes
Tests