Skip to content

Commit

Permalink
fix(backend): InstanceEntityService.packMany に me が渡っていないのを修正 (#14360)
Browse files Browse the repository at this point in the history
* fix: pass current user into `InstanceEntityService.packMany`

(cherry picked from commit 858ba188768017764c61c4a5591bdf2524a850e7)

* Update Changelog

* origin

* Update Changelog

---------

Co-authored-by: Hazel K <acomputerdog@gmail.com>
  • Loading branch information
kakkokari-gtyih and warriordog committed Aug 11, 2024
1 parent 046f243 commit 0aaf74e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
- 通知ページや通知カラム(デッキ)を開いている状態において、新たに発生した通知が既読されない問題が修正されます。
- これにより、プッシュ通知が有効な同条件下の環境において、プッシュ通知が常に発生してしまう問題も修正されます。
- Fix: Play各種エンドポイントの返り値に`visibility`が含まれていない問題を修正
- Fix: サーバー情報取得の際にモデレーター限定の情報が取得できないことがあるのを修正
(Cherry-picked from https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/582)

## 2024.7.0

Expand Down
3 changes: 2 additions & 1 deletion packages/backend/src/core/entities/InstanceEntityService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,9 @@ export class InstanceEntityService {
@bindThis
public packMany(
instances: MiInstance[],
me?: { id: MiUser['id']; } | null | undefined,
) {
return Promise.all(instances.map(x => this.pack(x)));
return Promise.all(instances.map(x => this.pack(x, me)));
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-

const instances = await query.limit(ps.limit).offset(ps.offset).getMany();

return await this.instanceEntityService.packMany(instances);
return await this.instanceEntityService.packMany(instances, me);
});
}
}
4 changes: 2 additions & 2 deletions packages/backend/src/server/api/endpoints/federation/stats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
const gotPubCount = topPubInstances.map(x => x.followingCount).reduce((a, b) => a + b, 0);

return await awaitAll({
topSubInstances: this.instanceEntityService.packMany(topSubInstances),
topSubInstances: this.instanceEntityService.packMany(topSubInstances, me),
otherFollowersCount: Math.max(0, allSubCount - gotSubCount),
topPubInstances: this.instanceEntityService.packMany(topPubInstances),
topPubInstances: this.instanceEntityService.packMany(topPubInstances, me),
otherFollowingCount: Math.max(0, allPubCount - gotPubCount),
});
});
Expand Down

0 comments on commit 0aaf74e

Please sign in to comment.