:fix: Handle error when no public field is present in the regex#239
:fix: Handle error when no public field is present in the regex#239wryonik wants to merge 15 commits into
Conversation
Update prod
…total-proofs feat: sort blueprints by total proofs
Due to incorrect order of useEffects, a race condition is occuring in the create blueprint flow randomly. During this, the github token is being fetched but some useEffect that requires it, runs before it and crashes the application
|
@cursor review |
There was a problem hiding this comment.
This PR is being reviewed by Cursor Bugbot
Details
You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
| regexGeneratedOutputs[index] !== undefined && | ||
| regexGeneratedOutputs[index] !== null && | ||
| regexGeneratedOutputs[index].length > 0 ? ( | ||
| {regex.parts.some((p: any) => p.isPublic) ? ( |
There was a problem hiding this comment.
Bug: Regex Parts Parsing Error
The condition checking for public regex parts directly calls .some() on regex.parts. This can lead to a runtime error when regex.parts is a string (JSON) instead of an array, as strings lack a .some() method. The parseRegexParts() helper is designed to handle both formats.
| parseRegexParts(regex.parts).length > 0 && | ||
| regexGeneratedOutputs[index] !== undefined && | ||
| regexGeneratedOutputs[index] !== null && | ||
| regexGeneratedOutputs[index].length > 0 ? ( |
There was a problem hiding this comment.
can you make the goal of these conditions more clear? maybe store them in a variable with a descriptive name so that in the future if we need to modify this it's easier to understand what is this doing
Note
Require at least one public regex part to show outputs; otherwise display an error prompting the user to add a public regex.
publicpart inregex.parts.Written by Cursor Bugbot for commit 302e782. This will update automatically on new commits. Configure here.