fix(api-service): mark v1 in-app api as deprecated in favor of new inbox apis#10618
fix(api-service): mark v1 in-app api as deprecated in favor of new inbox apis#10618jainpawan21 wants to merge 2 commits intonextfrom
Conversation
✅ Deploy Preview for dashboard-v2-novu-staging canceled.
|
|
Hey there and thank you for opening this pull request! 👋 We require pull request titles to follow specific formatting rules and it looks like your proposed title needs to be adjusted. Your PR title is: Requirements:
Expected format: Details: PR title must end with 'fixes TICKET-ID' (e.g., 'fixes NOV-123') or include ticket ID in branch name |
📝 WalkthroughWalkthroughUpdated Swagger/OpenAPI metadata for multiple v1 notification/feed/message endpoints in SubscribersV1Controller. Added deprecation notices to endpoint descriptions and marked endpoints with the Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Suggested reviewers
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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 |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@apps/api/src/app/subscribers/subscribersV1.controller.ts`:
- Around line 659-663: Update the ApiOperation description on the deprecated
markAs handler to consistently point to the v2 endpoint and remove the confusing
v1 path reference: edit the ApiOperation decorator (above the markAs method in
subscribersV1.controller.ts) so the description states that this API is
deprecated and directs consumers to the v2 path (e.g., the v2
'/subscribers/:subscriberId/messages/mark-as' endpoint) for consistent read/seen
handling, removing the mixed guidance that currently references the v1-style
path.
- Around line 691-693: The route description in subscribersV1.controller.ts
contains a duplicated deprecation sentence; open the description value for the
affected endpoint (the description property in the controller's route config)
and remove the repeated "This API is deprecated, use v2 API instead." so the
deprecation appears only once while preserving the rest of the explanatory text
and keeping deprecated: true unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 048da4ce-5388-4181-a03e-bce39674c454
📒 Files selected for processing (1)
apps/api/src/app/subscribers/subscribersV1.controller.ts
| @ApiOperation({ | ||
| summary: 'Mark a subscriber feed messages as seen or as read', | ||
| description: `Introducing '/:subscriberId/messages/mark-as endpoint for consistent read and seen message handling, | ||
| description: `This API is deprecated, use v2 API instead. Introducing '/:subscriberId/messages/mark-as endpoint for consistent read and seen message handling, | ||
| deprecating old legacy endpoint.`, | ||
| deprecated: true, |
There was a problem hiding this comment.
Clarify migration target in legacy markAs description.
Line 661 currently says to use v2, but the same sentence also says “introducing /:subscriberId/messages/mark-as,” which points to a v1 path and creates mixed guidance.
✏️ Suggested wording cleanup
`@ApiOperation`({
summary: 'Mark a subscriber feed messages as seen or as read',
- description: `This API is deprecated, use v2 API instead. Introducing '/:subscriberId/messages/mark-as endpoint for consistent read and seen message handling,
- deprecating old legacy endpoint.`,
+ description: `This API is deprecated, use v2 API instead. This legacy '/:subscriberId/messages/markAs' endpoint is maintained for backward compatibility only.`,
deprecated: true,
})📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| @ApiOperation({ | |
| summary: 'Mark a subscriber feed messages as seen or as read', | |
| description: `Introducing '/:subscriberId/messages/mark-as endpoint for consistent read and seen message handling, | |
| description: `This API is deprecated, use v2 API instead. Introducing '/:subscriberId/messages/mark-as endpoint for consistent read and seen message handling, | |
| deprecating old legacy endpoint.`, | |
| deprecated: true, | |
| `@ApiOperation`({ | |
| summary: 'Mark a subscriber feed messages as seen or as read', | |
| description: `This API is deprecated, use v2 API instead. This legacy '/:subscriberId/messages/markAs' endpoint is maintained for backward compatibility only.`, | |
| deprecated: true, |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@apps/api/src/app/subscribers/subscribersV1.controller.ts` around lines 659 -
663, Update the ApiOperation description on the deprecated markAs handler to
consistently point to the v2 endpoint and remove the confusing v1 path
reference: edit the ApiOperation decorator (above the markAs method in
subscribersV1.controller.ts) so the description states that this API is
deprecated and directs consumers to the v2 path (e.g., the v2
'/subscribers/:subscriberId/messages/mark-as' endpoint) for consistent read/seen
handling, removing the mixed guidance that currently references the v1-style
path.
| description: `This API is deprecated, use v2 API instead. Update subscriber's multiple in-app notifications state such as seen, read, unseen or unread by **subscriberId**. | ||
| **messageId** is of type mongodbId of notifications. This API is deprecated, use v2 API instead.`, | ||
| deprecated: true, |
There was a problem hiding this comment.
Remove duplicated deprecation sentence in description.
Line 691 and Line 692 repeat the same deprecation statement, which adds noise in generated docs.
✏️ Suggested wording cleanup
`@ApiOperation`({
summary: 'Update notifications state',
description: `This API is deprecated, use v2 API instead. Update subscriber's multiple in-app notifications state such as seen, read, unseen or unread by **subscriberId**.
- **messageId** is of type mongodbId of notifications. This API is deprecated, use v2 API instead.`,
+ **messageId** is of type mongodbId of notifications.`,
deprecated: true,
})📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| description: `This API is deprecated, use v2 API instead. Update subscriber's multiple in-app notifications state such as seen, read, unseen or unread by **subscriberId**. | |
| **messageId** is of type mongodbId of notifications. This API is deprecated, use v2 API instead.`, | |
| deprecated: true, | |
| description: `This API is deprecated, use v2 API instead. Update subscriber's multiple in-app notifications state such as seen, read, unseen or unread by **subscriberId**. | |
| **messageId** is of type mongodbId of notifications.`, | |
| deprecated: true, |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@apps/api/src/app/subscribers/subscribersV1.controller.ts` around lines 691 -
693, The route description in subscribersV1.controller.ts contains a duplicated
deprecation sentence; open the description value for the affected endpoint (the
description property in the controller's route config) and remove the repeated
"This API is deprecated, use v2 API instead." so the deprecation appears only
once while preserving the rest of the explanatory text and keeping deprecated:
true unchanged.
What changed? Why was the change needed?
What changed
Updated multiple endpoints in
SubscribersV1Controllerto mark them as deprecated in favor of v2 APIs. Addeddeprecated: trueto the Swagger@ApiOperationdecorators and updated endpoint descriptions to direct users to use the v2 inbox APIs instead. This affects endpoints for retrieving notifications feed, unseen count, marking messages as seen/read, updating notification states, and updating notification action status. No runtime behavior changes—this is purely a documentation and API contract update.Affected areas
api — Updated Swagger metadata for v1 in-app notification and subscriber preference endpoints in
SubscribersV1Controllerto mark them as deprecated and redirect consumers to v2 APIs.Testing
No tests were added. The change is documentation-only and does not affect runtime behavior or data handling, so existing test coverage remains sufficient.
Screenshots
Expand for optional sections
Related enterprise PR
Special notes for your reviewer
Note
Low Risk
Low risk: only Swagger metadata/docstrings are updated to flag these v1 endpoints as deprecated; no runtime behavior or data handling changes.
Overview
Marks several
SubscribersV1Controllerin-app notification endpoints as deprecated in the OpenAPI docs by addingdeprecated: trueand updating descriptions to direct consumers to the v2 inbox APIs (feed retrieval, unseen count, message state updates, and action status updates).Reviewed by Cursor Bugbot for commit 04b1c00. Configure here.