Skip to content

fix(web-console): do not start a quote in comments#483

Merged
bluestreak01 merged 1 commit intomainfrom
fix/quote-in-comment
Oct 10, 2025
Merged

fix(web-console): do not start a quote in comments#483
bluestreak01 merged 1 commit intomainfrom
fix/quote-in-comment

Conversation

@emrberk
Copy link
Copy Markdown
Collaborator

@emrberk emrberk commented Oct 7, 2025

The query extraction logic was problematic due to not ignoring single quotes inside a comment. It was taking

/* This shows us whether there's
stronger buying or selling interest.
*/
DECLARE
  @bid_prices := bids[1],
  @bid_volumes := bids[2],
  @ask_prices := asks[1],
  @ask_volumes := asks[2],
  @best_bid_price := bids[1, 1],
  @best_ask_price := asks[1, 1]
SELECT
  timestamp,
  round((@best_bid_price + @best_ask_price) / 2, 2) mid_price,
  (mid_price - @bid_prices) * @bid_volumes weighted_bid_pressure,
  (@ask_prices - mid_price) * @ask_volumes weighted_ask_pressure
FROM market_data WHERE timestamp > dateadd('h', -1, now()) AND symbol='EURUSD';
select 1;

as a single query. This PR adds a check for comments when toggling the inQuote variable

@emrberk emrberk requested a review from Copilot October 7, 2025 10:53
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a bug in the web console's SQL query parser where single quotes inside comments were incorrectly toggling the quote state, causing issues with query boundary detection.

  • Fixed quote handling logic to ignore quotes when inside comments
  • Added comprehensive test coverage for comments containing quotes and semicolons
  • Enhanced test infrastructure to support custom localStorage configuration

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
packages/web-console/src/scenes/Editor/Monaco/utils.ts Added condition to prevent quote state changes when inside comments
packages/browser-tests/cypress/integration/console/editor.spec.js Added new test cases for quote handling in comments and updated test setup
packages/browser-tests/cypress/commands.js Enhanced storage handling functions to support custom localStorage items

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@emrberk emrberk force-pushed the fix/quote-in-comment branch from 2e7f972 to fab6752 Compare October 7, 2025 10:54
@emrberk emrberk requested a review from bluestreak01 October 7, 2025 12:06
Copy link
Copy Markdown

@javier javier left a comment

Choose a reason for hiding this comment

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

Works for me!

@bluestreak01 bluestreak01 merged commit dd239f8 into main Oct 10, 2025
4 checks passed
@bluestreak01 bluestreak01 deleted the fix/quote-in-comment branch October 10, 2025 13:37
Vaibhav91one pushed a commit to Vaibhav91one/ui that referenced this pull request Oct 28, 2025
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.

4 participants