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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 Fixed Tiers API erroring when invalid filter passed #19845

Merged
merged 2 commits into from Mar 12, 2024

Conversation

allouis
Copy link
Contributor

@allouis allouis commented Mar 12, 2024

closes ENG-730
closes https://linear.app/tryghost/issue/ENG-730/

We've updated the input serializer to parse the filter, and responded with an error if it cannot be parsed correctly.

Now that it's parsed, we can pass a mongo query object through the stack, which will lend itself to better typing for this code, which is a direction we want to go in anyway. We've had to update all the internal usages of the browse method to use mongo query objects.

ref ENG-730
ref https://linear.app/tryghost/issue/ENG-730/

We've updated the input serializer to parse the filter, and responded with an
error if it cannot be parsed correctly.

Now that it's parsed, we can pass a mongo query object through the stack, which
will lend itself to better typing for this code, which is a direction we want
to go in anyway. We've had to update all the internal usages of the `browse`
method to use mongo query objects.
@allouis allouis merged commit 5a5ddcb into main Mar 12, 2024
20 checks passed
@allouis allouis deleted the egg-eng-730-handle-invalid-filter-in-tiers-repository branch March 12, 2024 17:25
Copy link

sentry-io bot commented Mar 13, 2024

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

  • 鈥硷笍 Query Error: unexpected character in filter at char 1
    (%0D%0Abms:%20bms)+ac
    -^
    Expecting 'LPAREN', 'PROP', got 'LITERAL': An unexpected error occurred, please try again.
    GET /ghost/api/content/tiers View Issue
  • 鈥硷笍 Query Error: unexpected character in filter at char 1
    (%0Dbms:%20bms)+activ
    -^
    Expecting 'LPAREN', 'PROP', got 'LITERAL': An unexpected error occurred, please try again.
    GET /ghost/api/content/tiers View Issue
  • 鈥硷笍 Query Error: unrecognized text "'" in filter at char 2
    ('"%27%22%3Cbmt%
    -^: An unexpected error occurred, please try again.
    GET /ghost/api/content/tiers View Issue

Did you find this useful? React with a 馃憤 or 馃憥

royalfig pushed a commit that referenced this pull request Mar 25, 2024
closes ENG-730
closes https://linear.app/tryghost/issue/ENG-730/

We've updated the input serializer to parse the filter, and responded
with an error if it cannot be parsed correctly.

Now that it's parsed, we can pass a mongo query object through the
stack, which will lend itself to better typing for this code, which is a
direction we want to go in anyway. We've had to update all the internal
usages of the `browse` method to use mongo query objects.
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

1 participant