Skip to content

Conversation

@m62624
Copy link
Member

@m62624 m62624 commented Jan 15, 2026

No description provided.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @m62624, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a crucial fix to ensure deterministic hashing of event variants by enforcing alphabetical sorting within the sails_event macro. This change guarantees consistent InterfaceId generation, which is vital for reliable inter-service communication and predictable system behavior. The implementation required updating various test cases and their corresponding snapshots to align with the new, stable InterfaceId values. Additionally, some test infrastructure was refactored to improve clarity and consistency in message header construction.

Highlights

  • Deterministic Hashing for Event Variants: Implemented alphabetical sorting of event variants within the sails_event macro to ensure deterministic order for hashing and routing. This prevents inconsistencies in InterfaceId generation.
  • Interface ID Updates: Updated numerous InterfaceId values across various test files and snapshots (examples/demo/client/src/lib.rs, rs/idl-gen/tests/generator.rs, and several snapshot files) to reflect the new deterministic hashing behavior.
  • Test Refactoring in RMRK Resource Module: Refactored tests in examples/rmrk/resource/wasm/tests/resources.rs to utilize SailsMessageHeader with explicit INTERFACE_ID, ENTRY_ID, and ROUTE_ID for message construction and event/reply assertions, moving away from string-based service and function names. This also involved removing redundant modules and adding a new helper function for test setup.
  • Temporarily Disabled Test: A test case service_fns_result_ty in rs/idl-gen/src/builder.rs was commented out with a TODO: Result unwrapping note, indicating a pending fix or refactor related to result type handling.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a fix to ensure deterministic hashing for event variants by sorting them alphabetically. This is a crucial change for protocol stability. The core logic change is in rs/macros/core/src/event/mod.rs. The rest of the changes involve updating tests, test data (like interface ID hashes), and snapshots to align with this new behavior. The changes look good overall. I've left a couple of minor suggestions to improve code quality in tests.

@vobradovich vobradovich self-requested a review January 15, 2026 11:28
@m62624 m62624 marked this pull request as ready for review January 15, 2026 11:38
@m62624 m62624 merged commit 7025dca into vo/idl-v2-macros-client Jan 15, 2026
3 checks passed
@m62624 m62624 deleted the fix/update-hash-events branch January 15, 2026 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants