Repository navigation
Add Delivery Modes (UI + persistence) and wire into AI flow; scaffold server & client - #19
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b3e7ca8f5e
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| router.delete('/:feedId', requireAuth, async (req: AuthRequest, res) => { | ||
| await prisma.feedConnection.delete({ where: { id: req.params.feedId } }); | ||
| res.status(204).send(); |
There was a problem hiding this comment.
Enforce ownership when deleting feeds
The delete handler removes a FeedConnection solely by id, so any authenticated user who can learn or guess another user’s feed ID can delete it. Because requireAuth only verifies the token and doesn’t check ownership, this route should scope the delete to userId (e.g., deleteMany with { id, userId } or a prior ownership check) to prevent cross-tenant data loss.
Useful? React with 👍 / 👎.
| router.delete('/:episodeId', requireAuth, async (req: AuthRequest, res) => { | ||
| await prisma.episode.delete({ where: { id: req.params.episodeId } }); | ||
| res.status(204).send(); |
There was a problem hiding this comment.
Enforce ownership when deleting episodes
The episode delete endpoint deletes by id without verifying that the episode belongs to the authenticated user. As written, any user with a valid token could delete another user’s episode if they obtain its ID. This should be scoped to userId (or validated before deletion) to avoid cross-account data deletion.
Useful? React with 👍 / 👎.
Motivation
Description
src/lib/delivery-modes.tsand abuildDeliveryPrompthelper to turn a mode into LLM guidance for generation.deliveryModetoUserSettingsinsrc/lib/settings.tsand updatedloadUserSettings/saveUserSettingsto merge defaults.DeliveryModeSelectorUI component atsrc/components/delivery-mode-selector.tsxand integrated it into the episode workspace (src/app/page.tsx), saving selections viasaveUserSettings.summarizeSocialFeedinput schema (src/ai/flows/summarize-social-feed.ts) and injecting thedeliveryModeprompt; updatedgenerateNewEpisodesignature and callers to pass the mode (src/app/actions.ts,src/app/page.tsx).src/app/history/page.tsxso archives remain explicitly immutable.src/lib/api.tsthat caused dev-time compile errors.server/(routes, Prisma schema, AI provider stub, Dockerfile), and a small Vite + React client scaffold underclient/, and updateddocker-compose.ymlto includeserverandclientservices.Testing
npm run devand the Next.js application compiled and served after fixing thesrc/lib/api.tsparse error (dev server reported Ready). — Success.artifacts/delivery-mode.png). — Partial success (Chromium timed out, WebKit succeeded and captured UI).src/lib/settings.test.tswas updated to include the newdeliveryModefield but automated unit tests were not run. — Not executed.Codex Task