quadro
CCConvex Community
•Created by quadro on 2/22/2025 in #support-community
Convex schema is not enforced properly
Ehi Tom thanks for the advice, here's the log:
[handleSuccessfulPayment] Error: {
error: '[Request ID: 90d012bbf3a4135e] Server Error\n' +
'Uncaught Error: Failed to insert or update a document in table "orders" because it does not match the schema: Found ID "jn7d950h4v4zdnktjazswr4dnx7at5zv" from table
orders
, which does not match the table name in validator v.id("offers")
.Path: .offerId\n' +
' at async handler (../convex/orders.ts:99:15)\n',
sessionId: 'cs_test_b1rbrBXXJU78vqp2800snAd4IKyQ9PJehibAgPdkyvzPx9IXXJAQ10p0fO',
offerId: 'jn7d950h4v4zdnktjazswr4dnx7at5zv',
timestamp: '2025-02-23T23:30:04.551Z'
}
the error is thrown from the catch block in convex order.ts mutation
i deleted all the orders from all my dev environments to catch any possible duplications or discrepancies.
the situation is pretty strange because:
my local environment is "perfect" it receive every right clean data timely and correctly.
my staging and prod environments are getting all the data but not the orders related ones.
one very puzzling thing is that if i remove all the validations from schema and mutations,to forcely write the data without checking types, the order from staging comes in, but is stored in my local environment order table.
yes you read correctly.
i can give you screenshot and paste snippets
thanks again for your time6 replies