Skip to content

Conversation

@FrederikBolding
Copy link
Member

@FrederikBolding FrederikBolding commented Nov 5, 2025

Include clientVersion and platformVersion in the response for snap_getClientStatus. This is useful for ensuring backwards compatibility in Snaps or enabling new features in certain versions.


Note

Add clientVersion and platformVersion to snap_getClientStatus, introduce getVersion hook, update types, simulation, and tests.

  • RPC Methods:
    • Extend snap_getClientStatus to include clientVersion and platformVersion in packages/snaps-rpc-methods/src/permitted/getClientStatus.ts.
    • Add getVersion to GetClientStatusHooks and use getPlatformVersion() in the implementation.
  • SDK Types:
    • Expand GetClientStatusResult to include clientVersion and platformVersion in packages/snaps-sdk/src/types/methods/get-client-status.ts.
  • Simulation:
    • Expose getVersion permitted hook (returns "13.6.0-flask.0") in packages/snaps-simulation/src/simulation.ts and add corresponding test.
  • Examples/Tests:
    • Update example snap test to assert new fields in packages/examples/packages/client-status/src/index.test.ts and add @metamask/snaps-utils devDependency.
    • Update getClientStatus tests to expect new fields.

Written by Cursor Bugbot for commit ed97239. This will update automatically on new commits. Configure here.

@codecov
Copy link

codecov bot commented Nov 5, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.28%. Comparing base (e5f394c) to head (ed97239).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3724   +/-   ##
=======================================
  Coverage   98.28%   98.28%           
=======================================
  Files         418      418           
  Lines       12152    12154    +2     
  Branches     1876     1876           
=======================================
+ Hits        11943    11945    +2     
  Misses        209      209           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@FrederikBolding FrederikBolding changed the title feat: Include versions in snap_getClientStatus feat: Include versions in snap_getClientStatus Nov 5, 2025
@FrederikBolding FrederikBolding marked this pull request as ready for review November 5, 2025 10:44
@FrederikBolding FrederikBolding requested a review from a team as a code owner November 5, 2025 10:44
* It returns an object containing useful information about the client.
*/
export type GetClientStatusResult = { locked: boolean; active: boolean };
export type GetClientStatusResult = {
Copy link
Member

Choose a reason for hiding this comment

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

Maybe a good opportunity to document the parameters now.

Copy link
Member Author

Choose a reason for hiding this comment

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

Mrtenz
Mrtenz previously approved these changes Nov 5, 2025

const getIsLocked = jest.fn().mockReturnValue(true);
const getIsActive = jest.fn().mockReturnValue(false);
const getVersion = jest.fn().mockReturnValue('13.6.0-flask.0');
Copy link

Choose a reason for hiding this comment

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

Bug: Test Expectation Mismatch for Hook Names

The test assertion for hookNames is missing the getVersion: true property that was added to the implementation. The test expects hookNames to only contain getIsLocked and getIsActive, but the implementation now includes getVersion as well (added at line 16 in getClientStatus.ts). This will cause the test to fail because the actual object has three properties while the test only expects two.

Fix in Cursor Fix in Web

@FrederikBolding FrederikBolding added this pull request to the merge queue Nov 5, 2025
Merged via the queue into main with commit 213c19a Nov 5, 2025
121 checks passed
@FrederikBolding FrederikBolding deleted the fb/expand-client-status branch November 5, 2025 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