Convex schema is not enforced properly
[CONVEX M(orders:setOrderPaid)] [LOG] 'Received offer ID:' 'jn7d950h4v4zdnktjazswr4dnx7at5zv'
[handleSuccessfulPayment] Error: {
error: '[Request ID: aeb2fb84dd5d9e4d] Server Error\n' +
'Uncaught ConvexError: Invalid offer ID: No matching offer found\n' +
' at handler (../convex/orders.ts:51:6)\n',
sessionId: 'cs_test_b1lwARf9sSn9khOxZklQlhXdupKi0Ay9psU26Ug6sWzLLofV6dN3PmOyut',
timestamp: '2025-02-22T15:17:10.468Z'
}
when i try to finalize an order using stripe checkout i pass some metadata into the session.
i use this metadata to populate my order.
in local environment everything is smooth and works as expected.
when i run this function in my staging or production environment, the mutation do not run giving me above error.
i double checked and the schema is not enforced properly, some fields when i try to run the function inside convex dashboard are missing, and some are not recognized for these two environments, although everything is deployed using commands as suggested for vercel using nextjs.
i also double checked in the dashboard the existence of the offer, using the same id i passed into the metadata, it does exist in my offer table
i tried to normalize the ids, casting it, upgrading convex to latest version but nothing.
have someone experienced such a mission critical bug?
every help or insight would be greatly appreciated.
i can share mutation schema and more logs if this can help
thank you
2 Replies
Thanks for posting in <#1088161997662724167>.
Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets.
- Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.)
- Use search.convex.dev to search Docs, Stack, and Discord all at once.
- Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI.
- Avoid tagging staff unless specifically instructed.
Thank you!
"Invalid offer ID: No matching offer found"
this looks like an error you throw in your code, can you console.log() the offer ID right before that to make sure it's what you think it is?
the schema is not enforced properly, some fields when i try to run the function inside convex dashboard are missingIf you check the history pane of the dashboard for this production deployment, do you see deploys from Vercel happening? Is this code actuallybeing updated?
i also double checked in the dashboard the existence of the offer, using the same id i passed into the metadata, it does exist in my offer tableGreat, sounds like adding a console.log right before this error should clear things up