Pause Notifications Error
7/7/2025, 2:13:40 PM [CONVEX M(socialMedia/pushNotifications:pausePushNotifications)] Uncaught Error: ArgumentValidationError: Found ID "j571cwsxpn17r8d4p7pkvdjdyh7gw31s" from table `notifications`, which does not match the table name in validator `v.id("users")`.Path: .userId
at async handler (../../convex/socialMedia/pushNotifications.ts:60:21)7/7/2025, 2:13:40 PM [CONVEX M(socialMedia/pushNotifications:pausePushNotifications)] Uncaught Error: ArgumentValidationError: Found ID "j571cwsxpn17r8d4p7pkvdjdyh7gw31s" from table `notifications`, which does not match the table name in validator `v.id("users")`.Path: .userId
at async handler (../../convex/socialMedia/pushNotifications.ts:60:21)I don't know what's wrong here as I am passing a field of type
Id<'users'>Id<'users'> here. Below is my code:
export const pausePushNotifications = mutation({
args: {
actionType: v.union(v.literal('pause'), v.literal('unpause')),
userId: v.id('users'),
},
handler: async (ctx, args) => {
if (args.actionType === 'pause') {
await pushNotifications.pauseNotificationsForUser(ctx, {
userId: args.userId,
});
} else {
await pushNotifications.unpauseNotificationsForUser(ctx, {
userId: args.userId,
});
}
},
});export const pausePushNotifications = mutation({
args: {
actionType: v.union(v.literal('pause'), v.literal('unpause')),
userId: v.id('users'),
},
handler: async (ctx, args) => {
if (args.actionType === 'pause') {
await pushNotifications.pauseNotificationsForUser(ctx, {
userId: args.userId,
});
} else {
await pushNotifications.unpauseNotificationsForUser(ctx, {
userId: args.userId,
});
}
},
});