diff --git a/packages/backend/src/core/activitypub/ApRendererService.ts b/packages/backend/src/core/activitypub/ApRendererService.ts index 9abb60ae0e..8f436f343d 100644 --- a/packages/backend/src/core/activitypub/ApRendererService.ts +++ b/packages/backend/src/core/activitypub/ApRendererService.ts @@ -595,7 +595,7 @@ export class ApRendererService { } @bindThis - public renderNoteUpdate(object: IObject, note: MiNote, user: { id: MiUser['id'] }): IUpdate { + public renderNoteUpdate(object: IPost, note: MiNote, user: { id: MiUser['id'] }): IUpdate { const activity: IUpdate = { id: `${this.config.url}/users/${user.id}#updates/${new Date().getTime()}`, actor: this.userEntityService.genLocalUserUri(note.userId), diff --git a/packages/backend/test/unit/activitypub.ts b/packages/backend/test/unit/activitypub.ts index 6962608106..a685dc556d 100644 --- a/packages/backend/test/unit/activitypub.ts +++ b/packages/backend/test/unit/activitypub.ts @@ -386,6 +386,25 @@ describe('ActivityPub', () => { }); }); + describe('Update', async () => { + const actor = createRandomActor(); + + const post = { + '@context': 'https://www.w3.org/ns/activitystreams', + id: `${host}/users/${secureRndstr(8)}`, + type: 'Note', + attributedTo: actor.id, + to: 'https://www.w3.org/ns/activitystreams#Public', + content: 'あ', + }; + + const note = await noteService.createNote(post.id, resolver, true); + + test('Update note', async () => { + rendererService.renderNoteUpdate(await rendererService.renderNote(note!, false, true), note!, actor); + }); + }); + describe('JSON-LD', () =>{ test('Compaction', async () => { const jsonLd = jsonLdService.use();