You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: cp-13.10.4 parse signed deep links with empty sig_params correctly (#38142)
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->
## **Description**
In previous versions, this link would not verify:
https://link.metamask.io/home?sig_params=&sig=OHXtQkiw6eH0yxVZb3wFabCEahlcimocFuh8I90u2nEF2Ats3ETf_fQ2qO4zEx8PYr5CXzU0PQFEOgXuGpmHvQ&utm_medium=github
Now it does.
[](https://codespaces.new/MetaMask/metamask-extension/pull/38142?quickstart=1)
## **Changelog**
<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`
If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`
(This helps the Release Engineer do their job more quickly and
accurately)
-->
CHANGELOG entry: signed deep links with empty `sig_params` with extra
params as valid
<!--
## **Related issues**
Fixes:
## **Manual testing steps**
1. Go to this page...
2.
3.
## **Screenshots/Recordings**
### **Before**
### **After**
-->
## **Pre-merge author checklist**
- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.
## **Pre-merge reviewer checklist**
- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Fixes deep link canonicalization/parsing for empty `sig_params`,
introduces a test-only `/test` route, and updates e2e/unit tests
accordingly.
>
> - **Deep Links**:
> - **Canonicalization**: `canonicalize` now treats present-but-empty
`sig_params` as valid, retaining only `sig_params` and removing all
other params; preserves original URL; sorts consistently.
> - **Parsing**: Ensures `sig_params` is stripped from handler params
and filters params strictly to those listed in `sig_params`.
> - **Helpers**: `signDeepLink` always appends `sig_params` (can be
empty) before signing; `getHashParams` simplified to read query directly
from hash.
> - **Routes**:
> - Adds test-only route `shared/lib/deep-links/routes/test-route.ts`
and conditionally registers it in `routes/index.ts` when
`ENABLE_SETTINGS_PAGE_DEV_OPTIONS` or `IN_TEST` is set; re-exports
`DEVELOPER_OPTIONS_ROUTE`.
> - **Tests**:
> - Unit: New cases for empty `sig_params` in `canonicalize.test.ts` and
handler param filtering in `parse.test.ts`.
> - E2E: Switch deep-link tests to `/test` route and add scenarios
covering empty `sig_params`, strict filtering, and unsigned flows.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
10d704d. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
0 commit comments