fix(core): reject findCreateFind when recovery fails - #18298
fix(core): reject findCreateFind when recovery fails#18298orlandohohmeier wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthrough
ChangesfindCreateFind error propagation
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 Biome (2.5.6)packages/core/src/model.jsFile contains syntax errors that prevent linting: Line 3: Illegal use of an import declaration outside of a module; Line 4: Illegal use of an import declaration outside of a module; Line 5: Illegal use of an import declaration outside of a module; Line 6: Illegal use of an import declaration outside of a module; Line 7: Illegal use of an import declaration outside of a module; Line 8: Illegal use of an import declaration outside of a module; Line 9: Illegal use of an import declaration outside of a module; Line 10: Illegal use of an import declaration outside of a module; Line 11: Illegal use of an import declaration outside of a module; Line 12: Illegal use of an import declaration outside of a module; Line 13: Illegal use of an import declaration outside of a module; Line 14: Illegal use of an import declaration outside of a module; Line 15: Illegal use of an import declaration outside of a module; Line 16: Illegal use of an import declaration outside of a module; Line 17: Illegal us ... [truncated 1592 characters] ... e 53: Illegal use of an import declaration outside of a module; Line 54: Illegal use of an import declaration outside of a module; Line 61: Illegal use of an import declaration outside of a module; Line 62: Illegal use of an import declaration outside of a module; Line 63: Illegal use of an import declaration outside of a module; Line 64: Illegal use of an import declaration outside of a module; Line 65: Illegal use of an import declaration outside of a module; Line 72: Illegal use of an import declaration outside of a module; Line 73: Illegal use of an import declaration outside of a module; Line 74: Illegal use of an import declaration outside of a module; Line 75: Illegal use of an import declaration outside of a module; Line 148: Illegal use of an export declaration outside of a module 🔧 ESLint
ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| if (foundAgain === null) { | ||
| throw error; | ||
| } |
There was a problem hiding this comment.
I'm still kinda back and forth on whether to re-throw here, mirroring findOrCreate and in line with what I would expect from a method returning a Promise, or adjust the type to make the potential null case explicit.
findCreateFind promises an instance when it resolves. Rethrow the create error if the duplicate-recovery lookup finds no row, matching findOrCreate instead of resolving with null. Co-Authored-By: Codex <noreply@openai.com>
a4c4145 to
8781e50
Compare
findCreateFind promises an instance when it resolves. Rethrow the create error if the duplicate-recovery lookup finds no row, matching findOrCreate instead of resolving with null.
Pull Request Checklist
Description of Changes
List of Breaking Changes
Summary by CodeRabbit
Bug Fixes
Tests