-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
✉️ Improve event attributes for store_object
#584
Conversation
WalkthroughRecent changes in the Axone Objectarium's Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Contract
participant Storage
participant Response
User->>Contract: store_object(object_data)
Contract->>Storage: save_object(object_data)
Storage-->>Contract: object_id, object_attributes
Contract->>Response: include attributes (size, compressed_size, pinned, action)
Response-->>User: send response with attributes
User->>Contract: pin_object(object_id)
Contract->>Storage: update_object_as_pinned(object_id)
Storage-->>Contract: updated_object_data
Contract-->>User: confirm pinning
Poem
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? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
store_object
store_object
Codecov ReportAll modified and coverable lines are covered by tests ✅
|
size-limit report 📦
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- contracts/axone-objectarium/src/contract.rs (11 hunks)
Additional comments not posted (5)
contracts/axone-objectarium/src/contract.rs (5)
Line range hint
123-147
: The functionstore_object
has been updated to handle additional attributes likesize
andcompressed_size
which are added based on the compression results. This change aligns with the PR objectives to enhance the event attribute returned when storing an object. However, ensure that all potential callers of this function are updated to handle these new attributes correctly.
171-171
: The function now returns aResponse
object with an attribute indicating the pin status. This change enhances the traceability and debuggability of pin operations. Ensure that all consumers of this function are aware of this new attribute to handle it appropriately in their logic.
171-171
: The update to thepin_object
function to manage the pinning status directly is a significant change. It simplifies the management of object states by directly modifying the pin status and ensures that the state is consistently managed across the system. This change should be thoroughly tested, especially in scenarios involving concurrent access to the same object by multiple clients.
171-171
: Theunpin_object
function has been correctly updated to handle the unpinning logic. This includes decrementing the pin count and removing the pin record if applicable. It's important to ensure that this function is called in all scenarios where an object's pin status needs to be revoked, to maintain the integrity of the system's state.
164-171
: The handling of thepin
parameter withinstore_object
has been enhanced. The function now correctly updates thepinned
attribute based on whether the object was successfully pinned or not. This is a crucial update for maintaining the integrity of pin state in the system. It is recommended to verify that themay_pin_object
function handles all edge cases correctly, especially with concurrent pin operations which might affect the pin count.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect thanks 🙏
Implement #556 by adding more attributes on the returned result when storing object in
Objectarium
. See comments in issue (#556) for more information about event attributes choices.Summary by CodeRabbit
New Features
Bug Fixes
Tests