Repository navigation
Update scrycast extension - #29026
Conversation
- Merge branch \'contributions/merge-1782409357204\' into contributions/merge-1782409232517 - Pull contributions - Pull contributions - Merge pull request raycast#4 from aayushpi/decks - added support for decks
|
Thank you for the update! 🎉 We're currently experiencing a high volume of incoming requests. As a result, the initial review may take up to 15 business days. |
Greptile SummaryThis PR centralises Scryfall API access by introducing
Confidence Score: 4/5Good infrastructure improvement, but the The
Important Files Changed
Prompt To Fix All With AIFix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
extensions/scrycast/src/search-view.tsx:87-88
**`isNotFound` guard broken after introducing `parseScryfallResponse`**
`parseScryfallResponse` throws `new Error(body.details)` — for Scryfall's 404 (no results) the detail string is `"Your query did not return any results."`, which contains neither `"404"` nor `"No cards found"`. With the old bare `useFetch`, `err.message` included the raw status code, so `includes("404")` matched. Now `isNotFound` is always `false` for empty searches, causing the `!isNotFound && !isBadSyntax` branch to fire and show a **"Search failed"** toast every time the user types a query that returns zero cards.
The same regression exists in `my-collection.tsx` line 131 where `isNotFound` is constructed identically. Both checks should key off the detail string instead (e.g. `err.message.includes("Your query did not return any results")`) or check `err.message.includes("not_found")` / a status-code property if available.
Reviews (2): Last reviewed commit: "Update CHANGELOG.md, add platforms field..." | Re-trigger Greptile |
| @@ -1,14 +1,19 @@ | |||
| ## [Unreleased] - 2026-05-11 | |||
| ## [Unreleased] - {PR_MERGE_DATE} | |||
There was a problem hiding this comment.
Per Raycast changelog conventions, non-initial-release entries should use a descriptive label such as
[Update] rather than [Unreleased]. The {PR_MERGE_DATE} placeholder is correct and should stay as-is.
| ## [Unreleased] - {PR_MERGE_DATE} | |
| ## [Update] - {PR_MERGE_DATE} |
Rule Used: What: Changelog entries must use {PR_MERGE_DATE}... (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: extensions/scrycast/CHANGELOG.md
Line: 1
Comment:
Per Raycast changelog conventions, non-initial-release entries should use a descriptive label such as `[Update]` rather than `[Unreleased]`. The `{PR_MERGE_DATE}` placeholder is correct and should stay as-is.
```suggestion
## [Update] - {PR_MERGE_DATE}
```
**Rule Used:** What: Changelog entries must use `{PR_MERGE_DATE}`... ([source](https://app.greptile.com/raycast/-/custom-context?memory=c2214c11-df56-490a-b1c0-09a385df481a))
How can I resolve this? If you propose a fix, please make it concise.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| const isBadSyntax = | ||
| err.message.includes("400") || | ||
| err.message.includes("invalid") || | ||
| err.message.includes("ignored") || | ||
| err.message.includes("Bad Request"); |
There was a problem hiding this comment.
With
parseScryfallResponse in place, the error message is now Scryfall's body.details string (e.g. "Your query is too broad"), not the raw HTTP response text. The "400" and "Bad Request" substrings can therefore never appear in err.message, making those two checks dead code. The meaningful guards are "invalid" and "ignored".
| const isBadSyntax = | |
| err.message.includes("400") || | |
| err.message.includes("invalid") || | |
| err.message.includes("ignored") || | |
| err.message.includes("Bad Request"); | |
| const isBadSyntax = | |
| err.message.includes("invalid") || | |
| err.message.includes("ignored"); |
Prompt To Fix With AI
This is a comment left during a code review.
Path: extensions/scrycast/src/search-view.tsx
Line: 96-100
Comment:
With `parseScryfallResponse` in place, the error message is now Scryfall's `body.details` string (e.g. `"Your query is too broad"`), not the raw HTTP response text. The `"400"` and `"Bad Request"` substrings can therefore never appear in `err.message`, making those two checks dead code. The meaningful guards are `"invalid"` and `"ignored"`.
```suggestion
const isBadSyntax =
err.message.includes("invalid") ||
err.message.includes("ignored");
```
How can I resolve this? If you propose a fix, please make it concise.|
Published to the Raycast Store: |
|
🎉 🎉 🎉 We've rewarded your Raycast account with some credits. You will soon be able to exchange them for some swag. |
| const { isLoading, data } = useFetch<ScryfallSearchResponse>( | ||
| `https://api.scryfall.com/cards/search?q=${encodeURIComponent(debouncedSearchText)}&unique=cards`, | ||
| `${SCRYFALL_API_BASE}/cards/search?q=${encodeURIComponent(debouncedSearchText)}&unique=cards`, |
There was a problem hiding this comment.
isNotFound guard broken after introducing parseScryfallResponse
parseScryfallResponse throws new Error(body.details) — for Scryfall's 404 (no results) the detail string is "Your query did not return any results.", which contains neither "404" nor "No cards found". With the old bare useFetch, err.message included the raw status code, so includes("404") matched. Now isNotFound is always false for empty searches, causing the !isNotFound && !isBadSyntax branch to fire and show a "Search failed" toast every time the user types a query that returns zero cards.
The same regression exists in my-collection.tsx line 131 where isNotFound is constructed identically. Both checks should key off the detail string instead (e.g. err.message.includes("Your query did not return any results")) or check err.message.includes("not_found") / a status-code property if available.
Prompt To Fix With AI
This is a comment left during a code review.
Path: extensions/scrycast/src/search-view.tsx
Line: 87-88
Comment:
**`isNotFound` guard broken after introducing `parseScryfallResponse`**
`parseScryfallResponse` throws `new Error(body.details)` — for Scryfall's 404 (no results) the detail string is `"Your query did not return any results."`, which contains neither `"404"` nor `"No cards found"`. With the old bare `useFetch`, `err.message` included the raw status code, so `includes("404")` matched. Now `isNotFound` is always `false` for empty searches, causing the `!isNotFound && !isBadSyntax` branch to fire and show a **"Search failed"** toast every time the user types a query that returns zero cards.
The same regression exists in `my-collection.tsx` line 131 where `isNotFound` is constructed identically. Both checks should key off the detail string instead (e.g. `err.message.includes("Your query did not return any results")`) or check `err.message.includes("not_found")` / a status-code property if available.
How can I resolve this? If you propose a fix, please make it concise.* Update scrycast extension - Merge branch \'contributions/merge-1782409357204\' into contributions/merge-1782409232517 - Pull contributions - Pull contributions - Merge pull request raycast#4 from aayushpi/decks - added support for decks * Update CHANGELOG.md, add platforms field and optimise images --------- Co-authored-by: raycastbot <[email protected]>
Description
Screenshot
Checklist
npm run buildand tested this distribution build in Raycastassetsfolder are used by the extension itselfREADMEare placed outside of themetadatafolder