pr_13574.patch 775 B

12345678910111213141516171819202122
  1. --- services/project-history/app/js/UpdateTranslator.js
  2. +++ services/project-history/app/js/UpdateTranslator.js
  3. @@ -73,9 +73,18 @@ function _convertToChange(projectId, updateWithBlob) {
  4. throw error
  5. }
  6. + let v2Authors
  7. + if (update.meta.user_id === 'anonymous-user') {
  8. + // history-v1 uses null to represent an anonymous author
  9. + v2Authors = [null]
  10. + } else {
  11. + // user_id is missing on resync operations that update the contents of a doc
  12. + v2Authors = _.compact([update.meta.user_id])
  13. + }
  14. +
  15. const rawChange = {
  16. operations,
  17. - v2Authors: _.compact([update.meta.user_id]),
  18. + v2Authors,
  19. timestamp: new Date(update.meta.ts).toISOString(),
  20. projectVersion,
  21. v2DocVersions: Object.keys(v2DocVersions).length ? v2DocVersions : null,