1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-04 21:15:45 +02:00

fix(backend): handle array or string in alsoKnownAs (#17275)

* fix: handle array or string in alsoKnownAs, closes #17274

* style: use more idiomatic toArray() for UserEntityService handling of alsoKnownAs

* fix: handle array-valued or unwrapped alsoKnownAs in ApPersonService

* doc: note about bugfix for alsoKnownAs
This commit is contained in:
Evan Prodromou
2026-04-04 11:43:37 -04:00
committed by GitHub
parent e601fcb729
commit 8169c57bd1
5 changed files with 144 additions and 88 deletions

View File

@@ -248,6 +248,16 @@ describe('UserEntityService', () => {
expect(actual.achievements).toEqual(achievements);
});
test('alsoKnownAs as string does not throw', async () => {
const me = await createUser();
const who = await createUser();
const whoWithStringAlsoKnownAs: MiUser = { ...who, alsoKnownAs: 'https://remote.example.com/users/alice' as any };
const actual = await service.pack(whoWithStringAlsoKnownAs, me, { schema: 'UserDetailedNotMe' }) as any;
expect(Array.isArray(actual.alsoKnownAs)).toBe(true);
});
describe('packManyによるpreloadがある時、preloadが無い時とpackの結果が同じになるか見たい', () => {
test('no-preload', async() => {
const me = await createUser();