mirror of
https://github.com/outline/outline.git
synced 2026-11-29 16:40:27 +03:00
fix: Issue introduced when document.editorVersion is null (#10352)
This commit is contained in:
1 parent
76868a3083
commit
bb72774f2d
3 files changed
+14
-6
No files matched your search
@@ -72,16 +72,24 @@ export default async function documentCollaborativeUpdater({
|
||||
...pudIds,
|
||||
]);
|
||||
|
||||
// Either the client or server version could be null, or they could both be
|
||||
// set. In that case we want to use the greater (newer) version.
|
||||
const editorVersion =
|
||||
document.editorVersion && clientVersion
|
||||
? semver.gt(clientVersion, document.editorVersion)
|
||||
? clientVersion
|
||||
: document.editorVersion
|
||||
: clientVersion
|
||||
? clientVersion
|
||||
: document.editorVersion;
|
||||
|
||||
await document.update(
|
||||
{
|
||||
content,
|
||||
state: Buffer.from(state),
|
||||
lastModifiedById,
|
||||
collaboratorIds,
|
||||
editorVersion:
|
||||
clientVersion && semver.gt(clientVersion, document.editorVersion)
|
||||
? clientVersion
|
||||
: document.editorVersion,
|
||||
editorVersion,
|
||||
},
|
||||
{
|
||||
transaction,
|
||||
|
||||
@@ -315,7 +315,7 @@ class Document extends ArchivableModel<
|
||||
msg: `editorVersion must be 255 characters or less`,
|
||||
})
|
||||
@Column
|
||||
editorVersion: string;
|
||||
editorVersion: string | null;
|
||||
|
||||
/** An icon to use as the document icon. */
|
||||
@Length({
|
||||
|
||||
@@ -48,7 +48,7 @@ class Revision extends ParanoidModel<
|
||||
})
|
||||
@Column
|
||||
@SkipChangeset
|
||||
editorVersion: string;
|
||||
editorVersion: string | null;
|
||||
|
||||
/** The document title at the time of the revision */
|
||||
@Length({
|
||||
|
||||
Reference in new issue
Block a user