|
|
@@ -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
|
|
|
}
|