mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-02 13:49:00 +02:00
Merge pull request #23447 from overleaf/em-reduce-validation-error-logs
Only log validation errors once per flush GitOrigin-RevId: ee3f656c4c7c09fd7f3ff2462278c9aef81b9bb5
This commit is contained in:
@@ -78,6 +78,12 @@ async function persistChanges(projectId, allChanges, limits, clientEndVersion) {
|
||||
let originalEndVersion
|
||||
let changesToPersist
|
||||
|
||||
/**
|
||||
* It's only useful to log validation errors once per flush. When we enforce
|
||||
* content hash validation, it will stop the flush right away anyway.
|
||||
*/
|
||||
let validationErrorLogged = false
|
||||
|
||||
limits = limits || {}
|
||||
_.defaults(limits, {
|
||||
changeBucketMinutes: 60,
|
||||
@@ -127,10 +133,13 @@ async function persistChanges(projectId, allChanges, limits, clientEndVersion) {
|
||||
} catch (err) {
|
||||
// Temporary: skip validation errors
|
||||
if (err instanceof InvalidChangeError) {
|
||||
logger.warn(
|
||||
{ err, projectId },
|
||||
'content snapshot mismatch (ignored)'
|
||||
)
|
||||
if (!validationErrorLogged) {
|
||||
logger.warn(
|
||||
{ err, projectId },
|
||||
'content snapshot mismatch (ignored)'
|
||||
)
|
||||
validationErrorLogged = true
|
||||
}
|
||||
} else {
|
||||
throw err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user