Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix unquoting queries with non escape characters #8562

Merged
merged 1 commit into from
May 14, 2024

Conversation

SpennyNDaJets
Copy link
Contributor

@SpennyNDaJets SpennyNDaJets commented May 14, 2024

Summary

The strconv.Unquote is intended for use in cases where you are processing go source code, so there are some rough edges when trying to unquote a string passed in from the frontend. Mainly, it cannot parse \d or \w` and other regex expressions since they are not valid go escape keys.

Update the method to trim the quotes and replace any internal quotes with the non escaped version - like we previously did for single quotes '

https://www.loom.com/share/e30f51d823d541e0a78d194139b95a85?sid=c5f92a46-e7df-4709-a30a-12b648bd0649

How did you test this change?

  1. Load one of the search experiences
  2. Search with the matches operator
  3. Add a search expression such as a number (/n) or word (/w) to the search within the quotes "
  • Same results as without quotes

Are there any deployment considerations?

N/A

Does this work require review from our design team?

N/A

Copy link

changeset-bot bot commented May 14, 2024

⚠️ No Changeset found

Latest commit: d594d34

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

💥 An error occurred when fetching the changed packages and changesets in this PR
Some errors occurred when validating the changesets config:
The package or glob expression "rrdom" is specified in the `ignore` option but it is not found in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.
The package or glob expression "rrdom-nodejs" is specified in the `ignore` option but it is not found in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.
The package or glob expression "rrweb" is specified in the `ignore` option but it is not found in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.
The package or glob expression "rrweb-player" is specified in the `ignore` option but it is not found in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.
The package or glob expression "rrweb-snapshot" is specified in the `ignore` option but it is not found in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.
The package or glob expression "@rrweb/types" is specified in the `ignore` option but it is not found in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.
The package or glob expression "@rrweb/web-extension" is specified in the `ignore` option but it is not found in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.
The package or glob expression "rrvideo" is specified in the `ignore` option but it is not found in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.

@SpennyNDaJets SpennyNDaJets marked this pull request as ready for review May 14, 2024 19:47
@SpennyNDaJets SpennyNDaJets requested review from a team, Vadman97 and ccschmitz and removed request for a team May 14, 2024 19:47
@SpennyNDaJets SpennyNDaJets changed the title Fix unquoting queries Fix unquoting queries with non escape characters May 14, 2024
Copy link
Contributor

@ccschmitz ccschmitz left a comment

Choose a reason for hiding this comment

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

Nice! Thanks for cleaning this up!

@SpennyNDaJets SpennyNDaJets merged commit 4dc5c91 into main May 14, 2024
21 checks passed
@SpennyNDaJets SpennyNDaJets deleted the spenny/fix-quotes-in-queries branch May 14, 2024 20:10
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.

None yet

3 participants