await or track more background delivery
This commit is contained in:
parent
11356acb98
commit
295b744db1
5 changed files with 14 additions and 11 deletions
|
|
@ -27,6 +27,7 @@ import { LatestNoteService } from '@/core/LatestNoteService.js';
|
|||
import { ApLogService } from '@/core/ApLogService.js';
|
||||
import type Logger from '@/logger.js';
|
||||
import { TimeService } from '@/global/TimeService.js';
|
||||
import { trackPromise } from '@/misc/promise-tracker.js';
|
||||
import { LoggerService } from '@/core/LoggerService.js';
|
||||
|
||||
@Injectable()
|
||||
|
|
@ -108,7 +109,7 @@ export class NoteDeleteService {
|
|||
? this.apRendererService.renderUndo(this.apRendererService.renderAnnounce(renote.uri ?? `${this.config.url}/notes/${renote.id}`, note), user)
|
||||
: this.apRendererService.renderDelete(this.apRendererService.renderTombstone(`${this.config.url}/notes/${note.id}`), user));
|
||||
|
||||
this.deliverToConcerned(user, note, content);
|
||||
trackPromise(this.deliverToConcerned(user, note, content));
|
||||
}
|
||||
|
||||
// also deliver delete activity to cascaded notes
|
||||
|
|
@ -117,7 +118,7 @@ export class NoteDeleteService {
|
|||
if (!cascadingNote.user) continue;
|
||||
if (!isLocalUser(cascadingNote.user)) continue;
|
||||
const content = this.apRendererService.addContext(this.apRendererService.renderDelete(this.apRendererService.renderTombstone(`${this.config.url}/notes/${cascadingNote.id}`), cascadingNote.user));
|
||||
this.deliverToConcerned(cascadingNote.user, cascadingNote, content);
|
||||
trackPromise(this.deliverToConcerned(cascadingNote.user, cascadingNote, content));
|
||||
}
|
||||
//#endregion
|
||||
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ export class NotePiningService {
|
|||
|
||||
// Deliver to remote followers
|
||||
if (this.userEntityService.isLocalUser(user) && !note.localOnly && ['public', 'home'].includes(note.visibility)) {
|
||||
this.deliverPinnedChange(user, note.id, true);
|
||||
await this.deliverPinnedChange(user, note.id, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -105,14 +105,14 @@ export class NotePiningService {
|
|||
throw new IdentifiableError('b302d4cf-c050-400a-bbb3-be208681f40c', `Note ${noteId} does not exist`);
|
||||
}
|
||||
|
||||
this.userNotePiningsRepository.delete({
|
||||
await this.userNotePiningsRepository.delete({
|
||||
userId: user.id,
|
||||
noteId: note.id,
|
||||
});
|
||||
|
||||
// Deliver to remote followers
|
||||
if (this.userEntityService.isLocalUser(user) && !note.localOnly && ['public', 'home'].includes(note.visibility)) {
|
||||
this.deliverPinnedChange(user, noteId, false);
|
||||
await this.deliverPinnedChange(user, noteId, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ import { renderInlineError } from '@/misc/render-inline-error.js';
|
|||
import { extractMediaFromHtml } from '@/core/activitypub/misc/extract-media-from-html.js';
|
||||
import { extractMediaFromMfm } from '@/core/activitypub/misc/extract-media-from-mfm.js';
|
||||
import { getContentByType } from '@/core/activitypub/misc/get-content-by-type.js';
|
||||
import { trackPromise } from '@/misc/promise-tracker.js';
|
||||
import { CustomEmojiService, encodeEmojiKey, isValidEmojiName } from '@/core/CustomEmojiService.js';
|
||||
import { TimeService } from '@/global/TimeService.js';
|
||||
import { getOneApId, getApId, validPost, isEmoji, getApType, isApObject, isDocument, IApDocument, isLink } from '../type.js';
|
||||
|
|
@ -300,7 +301,7 @@ export class ApNoteService implements OnModuleInit {
|
|||
await this.pollService.vote(actor, reply, index);
|
||||
|
||||
// リモートフォロワーにUpdate配信
|
||||
this.pollService.deliverQuestionUpdate(reply);
|
||||
trackPromise(this.pollService.deliverQuestionUpdate(reply));
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
|
@ -479,7 +480,7 @@ export class ApNoteService implements OnModuleInit {
|
|||
await this.pollService.vote(actor, reply, index);
|
||||
|
||||
// リモートフォロワーにUpdate配信
|
||||
this.pollService.deliverQuestionUpdate(reply);
|
||||
trackPromise(this.pollService.deliverQuestionUpdate(reply));
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ import { AvatarDecorationService } from '@/core/AvatarDecorationService.js';
|
|||
import { notificationRecieveConfig } from '@/models/json-schema/user.js';
|
||||
import { userUnsignedFetchOptions } from '@/const.js';
|
||||
import { renderInlineError } from '@/misc/render-inline-error.js';
|
||||
import { trackPromise } from '@/misc/promise-tracker.js';
|
||||
import { ApiLoggerService } from '../../ApiLoggerService.js';
|
||||
import { ApiError } from '../../error.js';
|
||||
|
||||
|
|
@ -640,12 +641,12 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
|
||||
// 鍵垢を解除したとき、溜まっていたフォローリクエストがあるならすべて承認
|
||||
if (user.isLocked && ps.isLocked === false) {
|
||||
this.userFollowingService.acceptAllFollowRequests(user);
|
||||
await this.userFollowingService.acceptAllFollowRequests(user);
|
||||
}
|
||||
|
||||
// フォロワーにUpdateを配信
|
||||
if (this.userNeedsPublishing(user, updates) || this.profileNeedsPublishing(profile, updatedProfile)) {
|
||||
this.accountUpdateService.publishToFollowers(user);
|
||||
trackPromise(this.accountUpdateService.publishToFollowers(user));
|
||||
}
|
||||
|
||||
return iObj;
|
||||
|
|
|
|||
|
|
@ -172,11 +172,11 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
if (note.userHost != null) {
|
||||
const pollOwner = await this.usersRepository.findOneByOrFail({ id: note.userId }) as MiRemoteUser;
|
||||
|
||||
this.queueService.deliver(me, this.apRendererService.addContext(await this.apRendererService.renderVote(me, vote, note, poll, pollOwner)), pollOwner.inbox, false);
|
||||
this.queueService.deliver(me, this.apRendererService.addContext(this.apRendererService.renderVote(me, vote, note, poll, pollOwner)), pollOwner.inbox, false);
|
||||
}
|
||||
|
||||
// リモートフォロワーにUpdate配信
|
||||
this.pollService.deliverQuestionUpdate(note);
|
||||
await this.pollService.deliverQuestionUpdate(note);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue