Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/RealtimeServer/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
],
"@typescript-eslint/naming-convention": ["error", { "selector": "enumMember", "format": ["PascalCase"] }],
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-floating-promises": "error",
"@typescript-eslint/no-misused-promises": "error",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-unused-vars": [
"error",
Expand Down Expand Up @@ -63,6 +65,10 @@
],
"no-underscore-dangle": "off"
}
},
{
"files": ["*.spec.ts"],
"rules": { "@typescript-eslint/no-floating-promises": "off", "@typescript-eslint/no-misused-promises": "off" }
}
]
}
2 changes: 1 addition & 1 deletion src/RealtimeServer/scriptureforge/migrator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,4 @@ async function runMigrations() {
}
}

runMigrations();
void runMigrations();
Original file line number Diff line number Diff line change
Expand Up @@ -222,19 +222,22 @@ export class NoteThreadService extends SFProjectDataService<NoteThread> {
return applicableDomains;
}

protected onDelete(userId: string, docId: string, projectDomain: string, entity: OwnedData): Promise<void> {
protected async onDelete(userId: string, docId: string, projectDomain: string, entity: OwnedData): Promise<void> {
if (projectDomain === SFProjectDomain.Notes) {
this.removeEntityHaveReadRefs(userId, docId, projectDomain, entity);
await this.removeEntityHaveReadRefs(userId, docId, projectDomain, entity);
}
return Promise.resolve();
}

protected onBeforeDelete(userId: string, docId: string, projectDomain: string, entity: OwnedData): Promise<void> {
protected async onBeforeDelete(
userId: string,
docId: string,
projectDomain: string,
entity: OwnedData
): Promise<void> {
// Process an incoming deletion for a NoteThread before it happens so we can look at its list of notes.
if (projectDomain === SFProjectDomain.PTNoteThreads) {
this.removeEntityHaveReadRefs(userId, docId, projectDomain, entity);
await this.removeEntityHaveReadRefs(userId, docId, projectDomain, entity);
}
return Promise.resolve();
}

private async removeEntityHaveReadRefs(
Expand Down
10 changes: 7 additions & 3 deletions src/RealtimeServer/scriptureforge/services/question-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,11 +238,15 @@ export class QuestionService extends SFProjectDataService<Question> {
];
}

protected onDelete(userId: string, docId: string, projectDomain: SFProjectDomain, entity: OwnedData): Promise<void> {
protected async onDelete(
userId: string,
docId: string,
projectDomain: SFProjectDomain,
entity: OwnedData
): Promise<void> {
if (projectDomain === SFProjectDomain.Answers || projectDomain === SFProjectDomain.AnswerComments) {
this.removeEntityReadRefs(userId, docId, projectDomain, entity);
await this.removeEntityReadRefs(userId, docId, projectDomain, entity);
}
return Promise.resolve();
}

private async removeEntityReadRefs(
Expand Down
Loading