Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 10, 2025

  • Understand the issue and codebase structure
  • Identify where query strings need to be trimmed
  • Add query string trimming in stateManager.ts
  • Create tests to validate the fix
  • Run linting and hygiene checks
  • Request code review
  • Run security checks
  • Fix CI test failure

Summary

Fixed issue where blank spaces at the end of query strings in GitHub Issues view configuration produce different results.

Changes

  • Modified src/issues/stateManager.ts: Added .trim() to query string after variable substitution (line 332)
  • Added test in src/test/issues/stateManager.test.ts: Verifies queries with trailing whitespace are properly trimmed
  • Fixed test mock to include remotes property to prevent CI failure

Security Summary

  • No vulnerabilities discovered by CodeQL analysis
  • The change is minimal and only affects query string processing
  • No security concerns with the .trim() operation
Original prompt

This section details on the original issue you should resolve

<issue_title>Blank space at end of query string produces different results</issue_title>
<issue_description>

Version: 1.100.0-insider (user setup)
Commit: ecbbe26188235072fbde7b6f4fd2a0bd6a7c9909
Date: 2025-04-29T05:04:19.843Z
Electron: 34.5.1
ElectronBuildId: 11369351
Chromium: 132.0.6834.210
Node.js: 20.19.0
V8: 13.2.152.41-electron.0
OS: Windows_NT x64 10.0.22635
  • Extension version: 0.109.2025042904 (pre-release)

  • Repository Clone Configuration (single repository/fork of an upstream repository): https://github.com/chrisdias/todo-app

  • Github Product (Github.com/Github Enterprise version x.x.x): Enterprise (not sure what... Microsoft)

A blank space at the end of a query string returns different results.

Blank space at end

Image

Remove the blank space, now I get an issue from another repository (the "Product Feedbac...") issue.

Image</issue_description>

<agent_instructions>Trim the query string before running it</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits December 10, 2025 16:47
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix blank space issue at end of query string Trim whitespace from issue query strings Dec 10, 2025
Copilot AI requested a review from alexr00 December 10, 2025 16:54
Copy link
Member

@alexr00 alexr00 left a comment

Choose a reason for hiding this comment

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

@copilot CI fails:

  1) StateManager branch behavior with useBranchForIssues setting
       should trim whitespace from query strings:
     TypeError: repository.state.remotes is not iterable
      at parseRepositoryRemotes (src/common/remote.ts:79:35)
      at StateManager.setIssueData (src/issues/stateManager.ts:318:51)
      at Context.<anonymous> (src/test/issues/stateManager.test.ts:165:32)
      at processImmediate (node:internal/timers:485:21)

Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Dec 15, 2025

@copilot CI fails:

  1) StateManager branch behavior with useBranchForIssues setting...

Fixed in commit 7720203. The mock repository was missing the remotes property that parseRepositoryRemotes() expects when iterating over repository.state.remotes.

Copilot AI requested a review from alexr00 December 15, 2025 10:05
@alexr00 alexr00 marked this pull request as ready for review December 15, 2025 10:08
@alexr00 alexr00 enabled auto-merge (squash) December 15, 2025 10:08
@vs-code-engineering vs-code-engineering bot added this to the December / January 2026 milestone Dec 15, 2025
lszomoru
lszomoru previously approved these changes Dec 15, 2025
@alexr00 alexr00 merged commit 3008bf9 into main Dec 15, 2025
6 checks passed
@alexr00 alexr00 deleted the copilot/fix-blank-space-query-string branch December 15, 2025 11:19
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.

Blank space at end of query string produces different results

4 participants