|
@@ -32,7 +32,7 @@ type RequestWithUser = IncomingMessage & { user: IUserHasId };
|
|
|
|
|
|
|
|
export interface IYjsService {
|
|
export interface IYjsService {
|
|
|
getYDocStatus(pageId: string): Promise<YDocStatus>;
|
|
getYDocStatus(pageId: string): Promise<YDocStatus>;
|
|
|
- syncWithTheLatestRevisionForce(pageId: string, editingMarkdownLength?: number): Promise<{ isYjsDataCorrupted?: boolean } | void>
|
|
|
|
|
|
|
+ syncWithTheLatestRevisionForce(pageId: string, editingMarkdownLength?: number): Promise<{ isYjsDataBroken?: boolean } | void>
|
|
|
getCurrentYdoc(pageId: string): Ydoc | undefined;
|
|
getCurrentYdoc(pageId: string): Ydoc | undefined;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -181,7 +181,7 @@ class YjsService implements IYjsService {
|
|
|
return YDocStatus.OUTDATED;
|
|
return YDocStatus.OUTDATED;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public async syncWithTheLatestRevisionForce(pageId: string, editingMarkdownLength?: number): Promise<{ isYjsDataCorrupted?: boolean } | void> {
|
|
|
|
|
|
|
+ public async syncWithTheLatestRevisionForce(pageId: string, editingMarkdownLength?: number): Promise<{ isYjsDataBroken?: boolean } | void> {
|
|
|
const doc = this.ysocketio.documents.get(pageId);
|
|
const doc = this.ysocketio.documents.get(pageId);
|
|
|
|
|
|
|
|
if (doc == null) {
|
|
if (doc == null) {
|
|
@@ -192,7 +192,7 @@ class YjsService implements IYjsService {
|
|
|
|
|
|
|
|
if (editingMarkdownLength != null) {
|
|
if (editingMarkdownLength != null) {
|
|
|
const ytextLength = doc?.getText('codemirror').length;
|
|
const ytextLength = doc?.getText('codemirror').length;
|
|
|
- return { isYjsDataCorrupted: editingMarkdownLength !== ytextLength };
|
|
|
|
|
|
|
+ return { isYjsDataBroken: editingMarkdownLength !== ytextLength };
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|