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.
Motivation
Parameters that contained invalid cast URLs with valid cast URL prefixes were surfacing database error instead of not found error. The url itself did not contain parent casts, but because it contained a valid prefix, the database lookups were returning errors.
For example, a valid URL may be: "https://warpcast.com/~/channel/japan777iine"
An invalid URL may be: "https://warpcast.com/~/chanel-makeup"
Since both URLs contain same prefix, part of the invalid param gets processed. That "prefix" then yields an error when entries aren't found in the database. However, no entries found is expected, because the URL is garbage.
Instead of surfacing the database error, we now correctly surface not found error. This should fix #2067
Change Summary
Empty URL
Invalid URL
Merge Checklist
Choose all relevant options below by adding an
x
now or at any time before submitting for reviewAdditional Context
If this is a relatively large or complex change, provide more details here that will help reviewers
PR-Codex overview
The focus of this PR is to fix the issue where the HTTP endpoint returns "not found" instead of an internal database error.
Detailed summary
cast_store.rs
file related to generating message primary keymessage.rs
andstore.rs
filesnot_found
instore.rs
server.ts
to handle Rust errors