Missing Slot 不要 Throw Error#231
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 (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthrough
ChangesparseSlot failure mode change
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Pull request overview
Adjusts Pretalx slot parsing in the Nuxt/Nitro server utilities so that sessions can be processed even when Pretalx data temporarily lacks a slot mapping (common while the schedule is still being arranged), addressing issue #229.
Changes:
- Change
parseSlotto no longer throw when a slot ID cannot be resolved. - Log the missing-slot condition and return
nullinstead.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if (!slot) { | ||
| throw createError(`Slot not found: ${slotId}`) | ||
| console.error(`Slot not found: ${slotId}`) | ||
| return null |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 508a8769df
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if (!slot) { | ||
| throw createError(`Slot not found: ${slotId}`) | ||
| console.error(`Slot not found: ${slotId}`) | ||
| return null |
There was a problem hiding this comment.
Reject sessions whose referenced slot is missing
When Pretalx returns a confirmed submission whose slots[0] points to a slot record that is absent from pretalxData.slots.map, this now returns null; the list endpoint drops that session, but server/api/session/[id]/index.get.ts continues with optional chaining and returns a 200 response with missing room/start/end. That makes a dangling-slot session accessible as an incomplete detail/API response even though it is absent from the schedule, so the detail route should treat a null slot like the existing “Slot not found” case or otherwise filter it consistently.
Useful? React with 👍 / 👎.
508a876 to
8f3ee5a
Compare
|
Caution Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted. Error details |
closed #229
Summary by CodeRabbit