Skip to content
Draft
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
3 changes: 0 additions & 3 deletions packages/backend/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ type Source = {
rootUserName?: string;
rootPassword?: string;
publishTarballInsteadOfProvideRepositoryUrl?: boolean;

objectStorage?: {
useObjectStorage: boolean;
objectStorageBaseUrl: string;
Expand Down Expand Up @@ -205,7 +204,6 @@ export type Config = {

version: string;
publishTarballInsteadOfProvideRepositoryUrl: boolean;
setupPassword: string | undefined;
host: string;
hostname: string;
scheme: string;
Expand Down Expand Up @@ -310,7 +308,6 @@ export function loadConfig(): Config {
version,
publishTarballInsteadOfProvideRepositoryUrl:
!!config.publishTarballInsteadOfProvideRepositoryUrl,
setupPassword: config.setupPassword,
url: url.origin,
port: config.port ?? parseInt(process.env.PORT ?? '', 10),
socket: config.socket,
Expand Down
26 changes: 12 additions & 14 deletions packages/backend/src/core/CustomEmojiService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,9 @@ export class CustomEmojiService implements OnApplicationShutdown {
.where('webhook.isActive = :isActive', { isActive: true })
.andWhere('webhook.on @> :eventName', { eventName: `{${eventType}}` })
.getMany();
console.log({ emoji, user: (me ? me : null) });
activeSystemWebhooksWithCustomEmojiRequest.forEach(it => this.systemWebhookService.enqueueSystemWebhook(
it.id,
eventType,
{ emoji, user: (me ? me : null) },
{ emoji, user: me ?? null },
));
}
@bindThis
Expand Down Expand Up @@ -204,20 +202,20 @@ export class CustomEmojiService implements OnApplicationShutdown {
public async update(data: (
{ id: MiEmoji['id'], name?: string; } | { name: string; id?: MiEmoji['id'], }
) & {
originalUrl?: string;
publicUrl?: string;
fileType?: string;
category?: string | null;
aliases?: string[];
license?: string | null;
isSensitive?: boolean;
localOnly?: boolean;
roleIdsThatCanBeUsedThisEmojiAsReaction?: MiRole['id'][];
}, moderator?: MiUser): Promise<
originalUrl?: string;
publicUrl?: string;
fileType?: string;
category?: string | null;
aliases?: string[];
license?: string | null;
isSensitive?: boolean;
localOnly?: boolean;
roleIdsThatCanBeUsedThisEmojiAsReaction?: MiRole['id'][];
}, moderator?: MiUser): Promise<
null
| 'NO_SUCH_EMOJI'
| 'SAME_NAME_EMOJI_EXISTS'
> {
> {
const emoji = data.id
? await this.getEmojiById(data.id)
: await this.getEmojiByName(data.name!);
Expand Down
20 changes: 11 additions & 9 deletions packages/backend/src/core/InboxRuleService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import { Inject, Injectable } from '@nestjs/common';
import { bindThis } from '@/decorators.js';
import type { MiRemoteUser } from '@/models/User.js';
import { IdService } from '@/core/IdService.js';
import { isCreate, isNote } from '@/core/activitypub/type.js';
import type { IObject, IPost } from '@/core/activitypub/type.js';
import { isNote } from '@/core/activitypub/type.js';
import type { IActivity } from '@/core/activitypub/type.js';
import type { InstancesRepository } from '@/models/_.js';
import { DI } from '@/di-symbols.js';
import { UtilityService } from '@/core/UtilityService.js';
Expand Down Expand Up @@ -35,7 +35,7 @@ export class InboxRuleService {
}

@bindThis
async evalCond(activity: IObject, user: MiRemoteUser, value: InboxRuleCondFormulaValue): Promise<boolean> {
async evalCond(activity: IActivity, user: MiRemoteUser, value: InboxRuleCondFormulaValue): Promise<boolean> {
const instanceUnpack = await this.instancesRepository
.findOneBy({ host: this.utilityService.toPuny(user.host) });
if (!instanceUnpack) {
Expand Down Expand Up @@ -105,27 +105,29 @@ export class InboxRuleService {
}
// メンション数が指定値以上
case 'maxMentionsMoreThanOrEq': {
if (isNote(activity.object)) {
return activity.object?.tag
? activity.object?.tag?.filter(t => t.type === 'Mention').length >= value.value
: false;
if (typeof activity.object === 'string') return false;
if (isNote(activity.object) && Array.isArray(activity.object.tag)) {
return activity.object.tag.filter((t: any) => t.type === 'Mention').length >= value.value;
}
return false;
}
// 添付ファイル数が指定値以上
case 'attachmentFileMoreThanOrEq': {
if (typeof activity.object === 'string') return false;
if (isNote(activity.object)) {
return activity.object?.attachment?.length ? activity.object?.attachment.length >= value.value : false;
return activity.object.attachment?.length ? activity.object.attachment.length >= value.value : false;
}
return false;
}
case 'thisActivityIsNote': {
if (typeof activity.object === 'string') return false;
return isNote(activity.object);
}
// 指定されたワードが含まれている
case 'isIncludeThisWord': {
if (typeof activity.object === 'string') return false;
if (isNote(activity.object)) {
return this.utilityService.isKeyWordIncluded(typeof activity.object?.content === 'string' ? activity.object?.content : '', [value.value]);
return this.utilityService.isKeyWordIncluded(typeof activity.object.content === 'string' ? activity.object.content : '', [value.value]);
}
return false;
}
Expand Down
13 changes: 9 additions & 4 deletions packages/backend/src/core/SystemWebhookService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,14 @@

import { Inject, Injectable } from '@nestjs/common';
import * as Redis from 'ioredis';
import type { MiUser, SystemWebhooksRepository } from '@/models/_.js';
import type { MiEmoji, MiEmojiRequest, MiUser, SystemWebhooksRepository } from '@/models/_.js';
import { DI } from '@/di-symbols.js';
import { bindThis } from '@/decorators.js';
import { GlobalEvents, GlobalEventService } from '@/core/GlobalEventService.js';
import { MiSystemWebhook, type SystemWebhookEventType } from '@/models/SystemWebhook.js';
import { IdService } from '@/core/IdService.js';
import { QueueService } from '@/core/QueueService.js';
import { ModerationLogService } from '@/core/ModerationLogService.js';
import { LoggerService } from '@/core/LoggerService.js';
import Logger from '@/logger.js';
import { Packed } from '@/misc/json-schema.js';
import { AbuseReportResolveType } from '@/models/AbuseUserReport.js';
import { ModeratorInactivityRemainingTime } from '@/queue/processors/CheckModeratorsActivityProcessorService.js';
Expand All @@ -37,16 +35,23 @@ export type AbuseReportPayload = {
resolvedAs: AbuseReportResolveType | null;
};

export type CustomEmojiRequestPayload = {
emoji: MiEmoji | MiEmojiRequest;
user: MiUser | null
};

export type InactiveModeratorsWarningPayload = {
remainingTime: ModeratorInactivityRemainingTime;
};

export type SystemWebhookPayload<T extends SystemWebhookEventType> =
T extends 'abuseReport' | 'abuseReportResolved' ? AbuseReportPayload :
T extends 'customEmojiRequest' | 'customEmojiRequestResolved' ? CustomEmojiRequestPayload :
T extends 'userCreated' ? Packed<'UserLite'> :
T extends 'userRegistered' ? { username: string, email: string | null, host: string | null } :
T extends 'inactiveModeratorsWarning' ? InactiveModeratorsWarningPayload :
T extends 'inactiveModeratorsInvitationOnlyChanged' ? Record<string, never> :
never;
never;

@Injectable()
export class SystemWebhookService implements OnApplicationShutdown {
Expand Down
34 changes: 20 additions & 14 deletions packages/backend/src/core/UtilityService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,16 @@ import RE2 from 're2';
import { DI } from '@/di-symbols.js';
import type { Config } from '@/config.js';
import { bindThis } from '@/decorators.js';
import type { MiMeta } from '@/models/Meta.js';

@Injectable()
export class UtilityService {
constructor(
@Inject(DI.config)
private config: Config,

@Inject(DI.meta)
private meta: MiMeta,
) {
}

Expand Down Expand Up @@ -117,18 +121,20 @@ export class UtilityService {
return host;
}

@bindThis
public isFederationAllowedHost(host: string): boolean {
if (this.meta.federation === 'none') return false;
if (this.meta.federation === 'specified' && !this.meta.federationHosts.some(x => `.${host.toLowerCase()}`.endsWith(`.${x}`))) return false;
if (this.isBlockedHost(this.meta.blockedHosts, host)) return false;

return true;
}

@bindThis
public isFederationAllowedUri(uri: string): boolean {
const host = this.extractDbHost(uri);
return this.isFederationAllowedHost(host);
}
//TODO 機能するように
// @bindThis
// public isFederationAllowedHost(host: string): boolean {
// if (this.meta.federation === 'none') return false;
// if (this.meta.federation === 'specified' && !this.meta.federationHosts.some(x => `.${host.toLowerCase()}`.endsWith(`.${x}`))) return false;
// if (this.isBlockedHost(this.meta.blockedHosts, host)) return false;
//
// return true;
// }

//TODO 機能するように
// @bindThis
// public isFederationAllowedUri(uri: string): boolean {
// const host = this.extractDbHost(uri);
// return this.isFederationAllowedHost(host);
// }
}
8 changes: 7 additions & 1 deletion packages/backend/src/core/WebhookTestService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ function generateAbuseReport(override?: Partial<MiAbuseUserReport>): AbuseReport
reporterHost: null,
resolvedAs: null,
moderationNote: 'foo',
notes: [],
noteIds: [],
...override,
};

Expand Down Expand Up @@ -88,6 +90,7 @@ function generateDummyUser(override?: Partial<MiUser>): MiUser {
uri: null,
followersUri: null,
token: null,
getPoints: 0,
...override,
};
}
Expand Down Expand Up @@ -130,6 +133,9 @@ function generateDummyNote(override?: Partial<MiNote>): MiNote {
replyUserHost: null,
renoteUserId: null,
renoteUserHost: null,
updatedAt: null,
updatedAtHistory: [],
noteEditHistory: [],
...override,
};
}
Expand Down Expand Up @@ -469,7 +475,7 @@ export class WebhookTestService {
}
default: {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const _exhaustiveAssertion: never = params.type;
const _exhaustiveAssertion: never = params.type as never;
return;
}
}
Expand Down
11 changes: 5 additions & 6 deletions packages/backend/src/core/activitypub/ApInboxService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -819,16 +819,15 @@ export class ApInboxService {
if (isActor(object)) {
await this.apPersonService.updatePerson(actor.uri, resolver, object);
return 'ok: Person updated';
// eslint-disable-next-line brace-style
} /*else if (getApType(object) === 'Question') {
await this.apQuestionService.updateQuestion(object, actor, resolver).catch(err => console.error(err));
return 'ok: Question updated';
}*/ else if (getApType(object) === 'Note' || getApType(object) === 'Question') {
} else if (getApType(object) === 'Note' || getApType(object) === 'Question') {
await this.updateNote(resolver, actor, object, false, activity);
return 'ok: Note updated';
} else {
return `skip: Unknown type: ${getApType(object)}`;
}
} /*else if (getApType(object) === 'Question') {
await this.apQuestionService.updateQuestion(object, actor, resolver).catch(err => console.error(err));
return 'ok: Question updated';
}*/
Comment on lines +822 to +830
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Question型の処理統合を確認してください。

Question型の更新処理がNote更新パスに統合されました。コメントアウトされたapQuestionService.updateQuestionの呼び出しが残っています。

確認事項:

  • updateNoteメソッドがQuestion型を正しく処理できることを確認してください
  • apQuestionService.updateQuestionに固有のロジックがあった場合、それが失われていないか検証してください
  • コメントアウトされたコード(Lines 827-830)は削除するか、適切なTODOコメントで追跡してください

以下のスクリプトでQuestionの処理を確認してください:


🏁 Script executed:

#!/bin/bash
# Description: updateNoteメソッドがQuestion型を処理できるか確認

# updateNoteメソッドの実装を確認
echo "=== updateNote implementation ==="
ast-grep --pattern $'updateNote($$$) {
  $$$
}'

# apQuestionService.updateQuestionの使用箇所を確認
echo "=== apQuestionService.updateQuestion usage ==="
rg -n "apQuestionService\.updateQuestion" --type=ts -C3

Length of output: 765


より詳細な情報が必要です。以下の検証を進めます:


🏁 Script executed:

#!/bin/bash
# Find updateNote method implementation
echo "=== Searching for updateNote method ==="
rg -n "updateNote\s*\(" --type=ts -B2 -A10 packages/backend/src/core/activitypub/ApInboxService.ts

# Check if updateNote has type guards for Question
echo "=== Check for Question handling in updateNote ==="
rg -n "Question" --type=ts packages/backend/src/core/activitypub/ApInboxService.ts

Length of output: 1977


🏁 Script executed:

#!/bin/bash
# Find apNoteService.updateNote method to see if it handles Question
echo "=== Finding apNoteService.updateNote method ==="
fd -n "ApNoteService" --type=f | head -5

# Check apNoteService.updateNote implementation
echo "=== Checking ApNoteService.updateNote implementation ==="
rg -n "updateNote\s*\(" --type=ts -A20 -g "*ApNoteService*"

# Compare with apQuestionService.updateQuestion
echo "=== Checking ApQuestionService.updateQuestion ==="
fd -n "ApQuestionService" --type=f | head -5

Length of output: 2666


🏁 Script executed:

#!/bin/bash
# Find ApQuestionService file
echo "=== Finding ApQuestionService file ==="
find packages/backend/src -name "*ApQuestionService*" -type f

# Find updateQuestion method in ApQuestionService
echo "=== Checking ApQuestionService.updateQuestion ==="
rg -n "updateQuestion\s*\(" --type=ts -A20 packages/backend/src/core/activitypub/models/

# Check what type apQuestionService.updateQuestion expects
echo "=== Check updateQuestion signature and implementation ==="
rg -n "class ApQuestionService" --type=ts -A50 packages/backend/src/core/activitypub/models/

Length of output: 7667


🏁 Script executed:

#!/bin/bash
# Get more context from updateQuestion to confirm poll update logic
echo "=== ApQuestionService.updateQuestion full implementation ==="
rg -n "updateQuestion\s*\(" --type=ts -A80 packages/backend/src/core/activitypub/models/ApQuestionService.ts | head -100

# Check if apNoteService handles polls
echo "=== Checking if apNoteService handles polls ==="
rg -n "poll" --type=ts packages/backend/src/core/activitypub/models/ApNoteService.ts | head -20

Length of output: 3549


Question型更新時のポーラ投票数同期が失われています。

ApQuestionService.updateQuestionはQuestion型のUpdate活動に対してポーラの投票数カウントを同期する重要な処理を行います。これをupdateNoteパスにマージすることで、この機能が失われています。

問題点:

  • apQuestionService.updateQuestionは既存のポーラの投票数を同期(lines 114-122)
  • updateNoteはノートコンテンツ更新のみで、ポーラ投票数の同期を行わない
  • Question型のUpdate活動でポーラの投票数が更新されなくなる

修正方法:

  • コメントアウトされたQuestion処理を復活させ、apQuestionService.updateQuestionを呼び出してください
  • または、updateNote内でQuestion型を検出して、apQuestionService.updateQuestionを別途呼び出すロジックを追加してください
  • コメントアウトされたコード(lines 827-830)は削除するか、TDOコメントで追跡してください
🤖 Prompt for AI Agents
In packages/backend/src/core/activitypub/ApInboxService.ts around lines 822 to
830, the Update handling merged Question into the updateNote path causing
apQuestionService.updateQuestion (which syncs poll/vote counts) to be skipped;
restore explicit Question handling by detecting getApType(object) === 'Question'
and calling await this.apQuestionService.updateQuestion(object, actor, resolver)
(propagate or log errors consistently and return an appropriate 'ok: Question
updated' message), or alternatively modify updateNote to detect Question and
call apQuestionService.updateQuestion there; also remove or convert the
commented-out block (lines 827-830) into either the active code or a TODO and
ensure the response strings remain consistent.

}

@bindThis
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/src/core/entities/MetaEntityService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export class MetaEntityService {
enableUrlPreview: instance.urlPreviewEnabled,
noteSearchableScope: (this.config.meilisearch == null || this.config.meilisearch.scope !== 'local') ? 'global' : 'local',
maxFileSize: this.config.maxFileSize,
federation: this.meta.federation,
// federation: this.meta.federation, //TODO 機能するように
};

return packed;
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/src/core/entities/UserEntityService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ export class UserEntityService implements OnModuleInit {
isBot: user.isBot,
isCat: user.isCat,
makeNotesFollowersOnlyBefore: (user.host && user.makeNotesFollowersOnlyBefore) ?? undefined,
makeNotesHiddenBefore: (user.host && user.makeNotesHiddenBefore )?? undefined,
makeNotesHiddenBefore: (user.host && user.makeNotesHiddenBefore ) ?? undefined,
instance: user.host ? this.federatedInstanceService.federatedInstanceCache.fetch(user.host).then(instance => instance ? {
name: instance.name,
softwareName: instance.softwareName,
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/src/misc/json-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import { packedClipSchema } from '@/models/json-schema/clip.js';
import { packedFederationInstanceSchema } from '@/models/json-schema/federation-instance.js';
import { packedQueueCountSchema } from '@/models/json-schema/queue.js';
import { packedGalleryPostSchema } from '@/models/json-schema/gallery-post.js';
import { packedEmojiDetailedSchema, packedEmojiRequestSimpleSchema, packedEmojiSimpleSchema, packedEmojiRequestDetailedSchema,packedEmojiDetailedAdminSchema } from '@/models/json-schema/emoji.js';
import { packedEmojiDetailedSchema, packedEmojiRequestSimpleSchema, packedEmojiSimpleSchema, packedEmojiRequestDetailedSchema, packedEmojiDetailedAdminSchema } from '@/models/json-schema/emoji.js';
import { packedFlashSchema } from '@/models/json-schema/flash.js';
import { packedAnnouncementSchema } from '@/models/json-schema/announcement.js';
import { packedSigninSchema } from '@/models/json-schema/signin.js';
Expand Down
22 changes: 11 additions & 11 deletions packages/backend/src/models/InboxRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,28 +152,28 @@ type CondFormulaValueServerIsSilenced = {
};

type CondFormulaValueServerPubLessThanOrEq = {
type : 'serverPubLessThanOrEq'
type: 'serverPubLessThanOrEq'
value: number;
}
};

type CondFormulaValueServerPubMoreThanOrEq = {
type : 'serverPubMoreThanOrEq'
type: 'serverPubMoreThanOrEq'
value: number;
}
};

type CondFormulaValueServerSubLessThanOrEq = {
type : 'serverSubLessThanOrEq'
type: 'serverSubLessThanOrEq'
value: number;
}
};

type CondFormulaValueServerSubMoreThanOrEq = {
type : 'serverSubMoreThanOrEq'
type: 'serverSubMoreThanOrEq'
value: number;
}
};

type CondFormulaThisActivityIsNote = {
type : 'thisActivityIsNote'
}
type: 'thisActivityIsNote'
};

export type InboxRuleCondFormulaValue = { id: string } & (
CondFormulaValueAnd |
Expand Down Expand Up @@ -207,7 +207,7 @@ export type InboxRuleCondFormulaValue = { id: string } & (
export type InboxRuleAction = {
type: 'reject' | 'messageRewrite';
rewrite?: string | null | undefined;
}
};

import { PrimaryColumn, Entity, Column } from 'typeorm';
import { id } from './util/id.js';
Expand Down
10 changes: 5 additions & 5 deletions packages/backend/src/models/json-schema/meta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -365,11 +365,11 @@ export const packedMetaLiteSchema = {
type: 'number',
optional: false, nullable: false,
},
federation: {
type: 'string',
enum: ['all', 'specified', 'none'],
optional: false, nullable: false,
},
// federation: {
// type: 'string',
// enum: ['all', 'specified', 'none'],
// optional: false, nullable: false,
// },
Comment on lines +368 to +372
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

API破壊的変更:連合機能フィールドの削除を確認してください。

federation フィールドをスキーマからコメントアウトすることで、公開APIから削除されています。これは既存のクライアントに影響を与える可能性があります。

懸念事項:

  • この変更により、MetaLite スキーマを使用しているクライアントが federation フィールドにアクセスできなくなります
  • コメントアウトされたコードは、完全に削除するか、適切なissue番号でTODOとして追跡する必要があります
  • 連合機能を再度有効にする予定がある場合、マイグレーション戦略を検討してください

この変更の影響範囲を確認するため、以下のスクリプトを実行してください:


🏁 Script executed:

#!/bin/bash
# Description: MetaLiteスキーマとfederationフィールドの使用箇所を検索

# MetaLiteスキーマの参照を検索
echo "=== MetaLite schema references ==="
rg -n "MetaLite" --type=ts -C3

# federationフィールドへのアクセスを検索
echo "=== federation field accesses ==="
rg -n "\.federation" --type=ts -C3

Length of output: 15819



🏁 Script executed:

#!/bin/bash
# Verify where instance variable gets populated in frontend

# Check the context around federation usage in common.ts
echo "=== common.ts federation usage context ==="
sed -n '55,75p' packages/frontend/src/ui/_common_/common.ts

# Check the context around federation usage in please-login.ts
echo -e "\n=== please-login.ts federation usage context ==="
sed -n '50,65p' packages/frontend/src/scripts/please-login.ts

# Search for instance variable definition/assignment
echo -e "\n=== Where does 'instance' come from in common.ts? ==="
rg -n "import.*instance|const.*instance.*=|let.*instance.*=" packages/frontend/src/ui/_common_/common.ts -B2 -A2

# Search for instance initialization in frontend
echo -e "\n=== Instance store/variable in frontend ==="
rg -n "misskeyInstance|instance.*=" packages/frontend/src/ --type=ts -l | head -10

Length of output: 1793


🏁 Script executed:

#!/bin/bash
# Verify where instance comes from and how it's populated

# Check import and initialization in common.ts
echo "=== common.ts imports and initialization ==="
head -70 packages/frontend/src/ui/_common_/common.ts | grep -A5 -B5 "instance"

# Check please-login.ts imports
echo -e "\n=== please-login.ts instance usage ==="
head -65 packages/frontend/src/scripts/please-login.ts | grep -A5 -B5 "instance\|federation"

Length of output: 1565



🏁 Script executed:

#!/bin/bash
# Check how instance is initialized in frontend

echo "=== packages/frontend/src/instance.ts content ==="
cat packages/frontend/src/instance.ts

Length of output: 2495


連合フィールド削除により、複数のフロントエンドファイルが破損します。

検証結果:スキーマからの federation フィールド削除がフロントエンド機能を直接破壊することを確認しました。

フロントエンドは /api/meta 端点から MetaDetailed 型として instance を取得し、以下の場所で federation フィールドにアクセスします:

  • packages/frontend/src/ui/common/common.ts:66if (instance.federation !== 'none') で連合メニュー表示を制御
  • packages/frontend/src/scripts/please-login.ts:58if (instance.federation !== 'none' || ...) でリモートログインオプション設定

バックエンド側でスキーマ(meta.ts:368-372)と MetaEntityService(line:147)から federation をコメントアウトすると、API レスポンスにこのフィールドが含まれなくなり、上記のフロントエンドコードで undefined 参照エラーが発生します。

修正必須:

  • federation フィールドを復元するか
  • フロントエンド両ファイルの federation アクセスをコンポーネント削除・リファクタリング含めて対応するか
  • どちらか一つを選択して進める
🤖 Prompt for AI Agents
In packages/backend/src/models/json-schema/meta.ts around lines 368-372 the
federation field was removed causing /api/meta to omit federation and break
frontend consumers; restore the federation schema entry with type 'string', enum
['all','specified','none'], and non-nullable/required flags (matching previous
semantics), then ensure MetaEntityService (around line 147) includes federation
in the emitted MetaDetailed object; after restoring, run backend tests and
verify packages/frontend/src/ui/_common_/common.ts:66 and
packages/frontend/src/scripts/please-login.ts:58 receive instance.federation (or
update those files if you intentionally choose to remove the feature instead of
restoring the field).

},
} as const;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export class SystemWebhookDeliverProcessorService {
public async process(job: Bull.Job<SystemWebhookDeliverJobData>): Promise<string> {
try {
this.logger.debug(`delivering ${job.data.webhookId}`);
this.logger.debug( JSON.stringify({
this.logger.debug(JSON.stringify({
server: this.config.url,
hookId: job.data.webhookId,
eventId: job.data.eventId,
Expand Down
4 changes: 2 additions & 2 deletions packages/backend/src/queue/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ export type EndedPollNotificationJobData = {
};

export type ScheduleNotePostJobData = {
scheduledNoteId: MiNote['id'];
}
scheduledNoteId: MiNote['id'];
};

type MinimumUser = {
id: MiUser['id'];
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/src/server/ActivityPubServerService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,7 @@ export class ActivityPubServerService {
});

// follow
fastify.get<{ Params: { followRequestId: string ; } }>('/follows/:followRequestId', async (request, reply) => {
fastify.get<{ Params: { followRequestId: string; } }>('/follows/:followRequestId', async (request, reply) => {
// This may be used before the follow is completed, so we do not
// check if the following exists and only check if the follow request exists.

Expand Down
Loading
Loading