[Repo Assist] refactor: use result.Parameters in DeepLinkHandler instead of re-parsing query#108
Draft
github-actions[bot] wants to merge 1 commit intomasterfrom
Conversation
…ing query DeepLinkParser.ParseDeepLink already parses the query string into result.Parameters (case-insensitive dictionary). The Handle method was calling GetQueryParam on the raw query string a second time for the 'send' and 'agent' cases — redundant work that also duplicated the parsing logic. Replace the GetQueryParam calls with result.Parameters.GetValueOrDefault and remove the now-unused `query` local variable. No behaviour change. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
26 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 This is an automated draft PR from Repo Assist.
Summary
DeepLinkParser.ParseDeepLinkalready parses the query string intoresult.Parameters(a case-insensitiveDictionary(string, string)). TheHandlemethod was then callingDeepLinkParser.GetQueryParamon the raw query string a second time for thesendandagentcases — redundant work that re-implemented parsing logic that had already run.Change
GetQueryParam(query, "message")withresult.Parameters.GetValueOrDefault("message")in thesendandagentswitch casesquerylocal variable (previouslyvar query = result.Query)No behaviour change — both approaches produce identical results because
ParseDeepLinkusesUri.UnescapeDataStringand case-insensitive key comparison, same asGetQueryParam.Why this is better
ParseDeepLink, once inGetQueryParam)queryvariable held but passed to a static re-parserresult.Parametersused directlyTest Status
503 tests passed (18 skipped — Windows-only integration tests), 93 Tray tests passed. No failures introduced.