Conversation
🦋 Changeset detectedLatest commit: 6ad2764 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Hi @deepshekhardas, thanks for your interest in contributing! This project requires that pull request authors are vouched, and you are not in the list of vouched users. This PR will be closed automatically. See https://github.com/triggerdotdev/trigger.dev/blob/main/CONTRIBUTING.md for more details. |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (17)
WalkthroughThis pull request introduces platform notifications admin improvements with expanded management capabilities. Changes include adding delete, edit, and publish-now actions to the notifications admin interface; introducing organization/project scoping for notifications and changelog filtering; updating responsive layout breakpoints from Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
| const notifications = await prisma.platformNotification.findMany({ | ||
| where: { | ||
| surface: "WEBAPP", | ||
| payload: { path: ["data", "type"], equals: "changelog" }, | ||
| startsAt: { lte: new Date() }, | ||
| OR: [ | ||
| { scope: "GLOBAL" }, | ||
| { scope: "USER", userId }, | ||
| ...(organizationId ? [{ scope: "ORGANIZATION" as const, organizationId }] : []), | ||
| ...(projectId ? [{ scope: "PROJECT" as const, projectId }] : []), | ||
| ], | ||
| }, | ||
| orderBy: [{ createdAt: "desc" }], | ||
| take: limit, |
There was a problem hiding this comment.
🚩 getRecentChangelogs now adds startsAt and scope filtering — behavioral change from old version
The old getRecentChangelogs at platformNotifications.server.ts:323-362 had no scope or startsAt filtering — it showed all changelogs regardless of scope or schedule. The new version adds startsAt: { lte: new Date() } and scope-based OR filtering. This is a positive security improvement (prevents user-scoped changelogs from leaking to other users, and hides future-scheduled changelogs), but it's also a behavioral change: changelogs scoped to an organization won't appear in the Help menu when viewing the Account Settings page (where no organizationId is available). This is probably the correct behavior but worth verifying with product expectations.
Was this helpful? React with 👍 or 👎 to provide feedback.
Closes #
✅ Checklist
Testing
[Describe the steps you took to test this change]
Changelog
[Short description of what has changed]
Screenshots
[Screenshots]
💯