Conversation
📝 WalkthroughWalkthroughThis pull request integrates the Expo Server SDK by adding the library as a dependency, replacing custom type definitions with Expo's native types (ExpoPushMessage, ExpoPushSuccessTicket, ExpoPushErrorTicket), and extending notification fields to support icon and richContent properties. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Tip Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord. 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 |
commit: |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/component/schema.ts (1)
44-44: Add a type-level assertion to preventNotificationFieldsandnotificationFieldsvalidator from silently drifting.Currently, there's no compile-time constraint linking the
NotificationFieldstype (line 44) to thenotificationFieldsvalidator (lines 6–42). While they're currently in sync withexpo-server-sdkv5, future SDK updates could cause them to diverge undetected. Consider using asatisfiesconstraint or anInfertype check to ensure any mismatch surfaces at compile time:export const notificationFields = { // ... fields } satisfies Record<keyof Omit<ExpoPushMessage, "to">, any>;Alternatively, use Convex's type inference to validate the validator against the type at compile time.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/component/schema.ts` at line 44, The NotificationFields type and the notificationFields validator can drift silently; add a compile-time constraint tying them together so mismatches error at build time: change the declaration of the notificationFields validator (symbol: notificationFields) to use a TypeScript "satisfies" or a type assertion against the keys of NotificationFields (symbol: NotificationFields) — e.g. have notificationFields satisfy Record<keyof NotificationFields, any> or assign it to a helper typed as Record<keyof NotificationFields, any> — so any added/removed fields between NotificationFields and notificationFields surface as type errors.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@package.json`:
- Around line 69-71: The package.json currently pins "expo-server-sdk" to
"^5.0.0" which is incorrect; change the version string for the "expo-server-sdk"
dependency to "4.0.0" in package.json, then run your package manager
(npm/yarn/pnpm) to update node_modules and the lockfile; optionally, if the code
only uses the exported type ExpoPushMessage via "import type", consider moving
"expo-server-sdk" to devDependencies after verifying no runtime imports exist,
and ensure tests/build succeed after the change.
---
Nitpick comments:
In `@src/component/schema.ts`:
- Line 44: The NotificationFields type and the notificationFields validator can
drift silently; add a compile-time constraint tying them together so mismatches
error at build time: change the declaration of the notificationFields validator
(symbol: notificationFields) to use a TypeScript "satisfies" or a type assertion
against the keys of NotificationFields (symbol: NotificationFields) — e.g. have
notificationFields satisfy Record<keyof NotificationFields, any> or assign it to
a helper typed as Record<keyof NotificationFields, any> — so any added/removed
fields between NotificationFields and notificationFields surface as type errors.
| "convex-helpers": "0.1.111", | ||
| "expo-server-sdk": "^5.0.0" | ||
| }, |
There was a problem hiding this comment.
🧩 Analysis chain
🌐 Web query:
expo-server-sdk npm latest version
💡 Result:
The latest npm version of expo-server-sdk (dist-tag latest) is 4.0.0. [1][2]
Install: npm i expo-server-sdk@latest [1]
Sources:
[1] Yarn package page (shows dist-tags and versions) (classic.yarnpkg.com)
[2] UNPKG package.json for v4.0.0 (app.unpkg.com)
Citations:
- 1: https://classic.yarnpkg.com/en/package/expo-server-sdk?utm_source=openai
- 2: https://app.unpkg.com/expo-server-sdk%404.0.0/files/package.json?utm_source=openai
Update expo-server-sdk to v4.0.0—v5 is not the current version.
The package specifies "^5.0.0", but the latest version on npm is v4.0.0. Update the dependency accordingly.
The original observation about dependency placement remains valid: only import type is used to reference ExpoPushMessage, so the SDK code is never executed at runtime. If the public type export were decoupled, this could move to devDependencies. However, prioritize the version correction first.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@package.json` around lines 69 - 71, The package.json currently pins
"expo-server-sdk" to "^5.0.0" which is incorrect; change the version string for
the "expo-server-sdk" dependency to "4.0.0" in package.json, then run your
package manager (npm/yarn/pnpm) to update node_modules and the lockfile;
optionally, if the code only uses the exported type ExpoPushMessage via "import
type", consider moving "expo-server-sdk" to devDependencies after verifying no
runtime imports exist, and ensure tests/build succeed after the change.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Summary by CodeRabbit
Release Notes