deeplinks: switchdash_to_gateway rejects a deeplink whose host differs in case
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 88/100
Research direction
Start in core/switch_core/deeplinks.py at switchdash_to_gateway, then review the existing cases in core/tests/switch_core/test_deeplinks.py. Add coverage for a deeplink whose host differs in case and verify that it is accepted rather than returning None. Run the deeplink tests; done means the mixed-case host follows the same rewrite path as the lowercase host.
Written by the indexing model from the issue text.
Description
switchdash_to_gateway in core/switch_core/deeplinks.py compares parts.netloc against the literal "session":
if parts.scheme != _DEEPLINK_SCHEME or parts.netloc != _DEEPLINK_HOST:
return None
urlsplit normalises the scheme to lower case but leaves netloc exactly as written. So the two halves of that check are not symmetric:
>>> urlsplit('SWITCHDASH://Session?server=a&room=b')
scheme='switchdash' netloc='Session'
A deeplink of the form switchdash://Session?… therefore returns None, and deeplink_for_platform falls back to posting the raw custom-scheme URL. On a platform that does not linkify custom schemes — Discord, which is the reason this rewrite exists — the user sees unclickable plain text instead of an "Open in Switch Console" link. It fails quietly: nothing logs, and the only symptom is a link that does not work.
Hosts are case-insensitive, so the comparison should be too. Case-folding netloc before the comparison would fix it.
Worth a test alongside the existing cases in core/tests/switch_core/test_deeplinks.py.
- Dominant language
- Python
- Stars
- 646
- Forks
- 52
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 137
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from sandbox-quantum/switch
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
sandbox-quantum/switch#454 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
sandbox-quantum/switch#453 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
sandbox-quantum/switch#451 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
sandbox-quantum/switch#375 ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
sandbox-quantum/switch#511 ·
All issues in sandbox-quantum/switch
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100