Skip to content

fix(rs): command reply tuple with value#1259

Merged
m62624 merged 3 commits intobackport-gear-apfrom
fix/command-reply-tuple-backport
Mar 25, 2026
Merged

fix(rs): command reply tuple with value#1259
m62624 merged 3 commits intobackport-gear-apfrom
fix/command-reply-tuple-backport

Conversation

@m62624
Copy link
Copy Markdown
Member

@m62624 m62624 commented Mar 25, 2026

No description provided.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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 refines the CommandReply mechanism within the Rust macro system, specifically addressing how replies with a unit type (()) are handled when they also contain a value. The changes ensure that such values are correctly processed and returned, even if the primary data payload is empty. This enhancement is demonstrated through a new example method in the FeeService and is reflected across the client-side IDL and generated client code, along with necessary updates to macro-generated test snapshots.

Highlights

  • Enhanced CommandReply Handling: Improved the macro system to correctly process CommandReply instances that return a unit type (()) but still carry an associated value, ensuring the value is handled even with an empty data payload.
  • New Example Method: Introduced a new take_fee_and_return_nothing method in the FeeService demo to showcase the functionality of CommandReply<()> with an associated value.
  • Client Code Generation Updates: Updated the client-side IDL and generated Rust client code to support the newly added take_fee_and_return_nothing method.
  • Macro Snapshot Adjustments: Refreshed numerous macro-generated snapshot tests across client-gen and macros/core to align with the refined CommandReply processing logic and formatting.
  • Dependency Branch Update: Modified the rmrk example's build script to fetch the sails dependency from the 'backport-gear-ap' git branch instead of 'master'.
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.

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
Copy Markdown
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 new take_fee_and_return_nothing function to the FeeService, updating the client-side IDL and Rust code to support it. It also includes updates to macro implementations to correctly handle CommandReply with unit types and values, leading to several snapshot updates for generated client code and macros. A review comment highlights a potential instability issue due to changing the sails repository branch from master to backport-gear-ap. Another comment suggests improving the readability of generated mock! macro code by placing each function definition on its own line, indicating a possible code generation formatting issue.

Comment thread examples/rmrk/resource/app/build.rs
Comment thread examples/demo/client/src/demo_client.rs Outdated
@m62624 m62624 marked this pull request as ready for review March 25, 2026 11:38
@m62624 m62624 requested a review from vobradovich March 25, 2026 11:38
@vobradovich vobradovich requested a review from gshep March 25, 2026 11:39
Copy link
Copy Markdown

@gshep gshep left a comment

Choose a reason for hiding this comment

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

👍

@m62624 m62624 merged commit d353728 into backport-gear-ap Mar 25, 2026
4 checks passed
@m62624 m62624 deleted the fix/command-reply-tuple-backport branch March 25, 2026 11:50
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