-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: unable to save legacy surveys #2280
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 2 Ignored Deployments
|
Thank you for following the naming conventions for pull request titles! 🙏 |
packages/lib/utils/validate.tsIt would be more readable if the error message included the name of the schema that failed validation, rather than the entire schema object. This would make the error message more concise and easier to understand. `Validation failed for ${JSON.stringify(value, null, 2)} and ${schema.name}: ${inputValidation.error.message}`
packages/lib/constants.tsIncreasing the revalidation interval from 30 minutes to 3 hours might not be the best solution for all cases. If the data changes frequently, this could lead to outdated data being served to the users. Consider implementing a more dynamic revalidation strategy, such as using webhooks or event-driven updates, to ensure data freshness without unnecessary revalidations. // Implement a dynamic revalidation strategy
|
@@ -10,7 +10,7 @@ export const validateInputs = (...pairs: ValidationPair[]): void => { | |||
|
|||
if (!inputValidation.success) { | |||
console.error( | |||
`Validation failed for ${value} and ${JSON.stringify(schema)}: ${inputValidation.error.message}` | |||
`Validation failed for ${JSON.stringify(value, null, 2)} and ${JSON.stringify(schema)}: ${inputValidation.error.message}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error message has been updated to include only the name of the schema that failed validation, making it more concise and easier to understand.
`Validation failed for ${JSON.stringify(value, null, 2)} and ${JSON.stringify(schema)}: ${inputValidation.error.message}` | |
console.error( | |
`Validation failed for ${JSON.stringify(value, null, 2)} and ${schema.name}: ${inputValidation.error.message}` | |
); |
export const REVALIDATION_INTERVAL = 0; //TODO: find a good way to cache and revalidate data when it changes | ||
export const SERVICES_REVALIDATION_INTERVAL = 60 * 30; // 30 minutes | ||
export const SERVICES_REVALIDATION_INTERVAL = 60 * 60 * 3; // 3 hours |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implement a dynamic revalidation strategy to ensure data freshness without unnecessary revalidations.
export const REVALIDATION_INTERVAL = 0; //TODO: find a good way to cache and revalidate data when it changes | |
export const SERVICES_REVALIDATION_INTERVAL = 60 * 30; // 30 minutes | |
export const SERVICES_REVALIDATION_INTERVAL = 60 * 60 * 3; // 3 hours | |
// TODO: Implement a dynamic revalidation strategy to ensure data freshness without unnecessary revalidations. | |
export const REVALIDATION_INTERVAL = 0; | |
export const SERVICES_REVALIDATION_INTERVAL = 60 * 60 * 3; // 3 hours |
What does this PR do?
fix: unable to save legacy surveys