Conversation
…n helper, and fix clear FCM
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughThis pull request removes the deprecated Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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 |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
src/commands/push/channels/remove.ts (1)
59-61: Format resource names in the confirmation text.Line 60 currently interpolates raw identifiers (
targetandflags.channel). UseformatResource(...)for those resource values to match command output conventions.As per coding guidelines, "Always use formatResource(name) (cyan) for resource names instead of quoted strings, including in logCliEvent messages".♻️ Proposed tweak
- const target = flags["device-id"] - ? `device ${flags["device-id"]}` - : `client ${flags["client-id"]}`; + const target = flags["device-id"] + ? `device ${formatResource(flags["device-id"])}` + : `client ${formatResource(flags["client-id"] as string)}`; if (!flags.force && !this.shouldOutputJson(flags)) { const confirmed = await promptForConfirmation( - `Are you sure you want to unsubscribe ${target} from channel ${flags.channel}?`, + `Are you sure you want to unsubscribe ${target} from channel ${formatResource(flags.channel)}?`, );🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/commands/push/channels/remove.ts` around lines 59 - 61, The confirmation prompt is interpolating raw identifiers; change the message passed to promptForConfirmation to wrap the channel and target using formatResource(...) so resource names follow the CLI convention; update the call in remove.ts (the promptForConfirmation invocation that currently uses `target` and `flags.channel`) to use formatResource(target) and formatResource(flags.channel) instead.src/commands/push/devices/remove.ts (1)
43-45: UseformatResourcein the confirmation prompt.Line 44 prints the device ID raw; wrap it with
formatResource(...)to keep resource rendering consistent with other command output.As per coding guidelines, "Always use formatResource(name) (cyan) for resource names instead of quoted strings, including in logCliEvent messages".♻️ Proposed tweak
- const confirmed = await promptForConfirmation( - `Are you sure you want to remove device ${deviceId}?`, - ); + const confirmed = await promptForConfirmation( + `Are you sure you want to remove device ${formatResource(deviceId)}?`, + );🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/commands/push/devices/remove.ts` around lines 43 - 45, The confirmation prompt currently interpolates the raw deviceId into promptForConfirmation; update the prompt to wrap the resource name with formatResource(deviceId) so the device is rendered consistently (cyan) across CLI output—locate the promptForConfirmation call in removeDevice flow and replace the raw ${deviceId} usage with formatResource(deviceId).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/commands/push/channels/remove.ts`:
- Around line 59-61: The confirmation prompt is interpolating raw identifiers;
change the message passed to promptForConfirmation to wrap the channel and
target using formatResource(...) so resource names follow the CLI convention;
update the call in remove.ts (the promptForConfirmation invocation that
currently uses `target` and `flags.channel`) to use formatResource(target) and
formatResource(flags.channel) instead.
In `@src/commands/push/devices/remove.ts`:
- Around line 43-45: The confirmation prompt currently interpolates the raw
deviceId into promptForConfirmation; update the prompt to wrap the resource name
with formatResource(deviceId) so the device is rendered consistently (cyan)
across CLI output—locate the promptForConfirmation call in removeDevice flow and
replace the raw ${deviceId} usage with formatResource(deviceId).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: dfffddf7-c57c-4d2e-9ba0-7ef0ec0c5b99
📒 Files selected for processing (10)
README.mdsrc/commands/apps/index.tssrc/commands/apps/set-apns-p12.tssrc/commands/push/channels/remove-where.tssrc/commands/push/channels/remove.tssrc/commands/push/config/clear-apns.tssrc/commands/push/config/clear-fcm.tssrc/commands/push/devices/remove-where.tssrc/commands/push/devices/remove.tstest/unit/commands/apps/set-apns-p12.test.ts
💤 Files with no reviewable changes (3)
- src/commands/apps/index.ts
- src/commands/apps/set-apns-p12.ts
- test/unit/commands/apps/set-apns-p12.test.ts
remove deprecated set-apns-p12 command path, use promptForConfirmation helper, and fix clear FCM
Closes #180, and addresses remaining feedback from #169
Summary by CodeRabbit
Documentation
ably apps set-apns-p12command examples.ably channels presence updateexample with--pretty-jsonflag for colorized output.Changes
ably apps set-apns-p12command.