Skip to content

fix: parse channel parameter from snap:// URLs (#1982)#2053

Open
gauravsaini wants to merge 1 commit intoubuntu:mainfrom
gauravsaini:fix/snap-url-channel-parameter-1982
Open

fix: parse channel parameter from snap:// URLs (#1982)#2053
gauravsaini wants to merge 1 commit intoubuntu:mainfrom
gauravsaini:fix/snap-url-channel-parameter-1982

Conversation

@gauravsaini
Copy link
Copy Markdown

Summary

Problem

When opening a snap:// URL with a channel parameter from snapcraft.io (e.g., snap://gimp?channel=preview/stable), the entire string after snap:// was being used as the snap name, causing "Something went wrong" error.

Changes

  • store_providers.dart: Use Uri.parse to properly extract snap name and channel parameter
  • store_routes.dart: Add channelOf method and channel parameter to namedSnap
  • store_app.dart: Pass channel from route to SnapPage
  • snap_page.dart: Accept channel parameter and select it when snap data loads
  • Added tests for channel parsing in routes and initial route

Testing

  • Unit tests verify channel parsing from routes
  • Unit tests verify snap URL with channel is correctly converted to named route

When opening snap:// URLs with a channel parameter (e.g.,
snap://gimp?channel=preview/stable), the channel is now properly
extracted and the snap page opens with the correct channel selected.

Changes:
- Parse URLs using Uri.parse to properly extract query parameters
- Add channelOf method to StoreRoutes
- Add channel parameter to namedSnap method
- Pass channel from route to SnapPage
- Select the specified channel when snap data loads
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.

"Something went wrong" is displayed while trying to open snap://snap_name?channel=non_latest_track

1 participant