fix(extension): 확장 토글 시 config 캐시 재생성을 동기 실행 (큐 지연 제거)

ExtensionConfigCacheListener 가 config 캐시 재생성을 큐로 디스패치해,
워커 미가동 환경·CLI 커맨드(plugin:deactivate 등)에서 재생성이 지연/누락되던
결함을 수정한다. 훅 Action 리스너의 기본 등록 정책이 큐 디스패치이므로,
getSubscribedHooks 각 훅에 'sync' => true 를 추가해 동기 실행한다.

- 회귀 테스트 test_all_hooks_are_synchronous 추가
- docs/backend/service-provider.md 에 sync 요구사항 명문화
- 2브라우저(Chrome MCP + Playwright MCP) 회귀 검증 중 발견
This commit is contained in:
HeuJung committed 2026-07-03 18:40:19 +09:00
1 parent c08dae7cb0
commit 710f8e9135
3 files changed
+23

No files matched your search

@@ -66,4 +66,19 @@ class ExtensionConfigCacheListenerTest extends TestCase
$this->assertArrayHasKey('priority', $config);
}
}
public function test_all_hooks_are_synchronous(): void
{
// config 캐시 재생성은 인프라 작업이라 큐로 미루면 안 된다. Action 훅의 기본 등록은
// 큐 디스패치(HookListenerRegistrar::applySubscribedHooks) 이므로, sync 플래그가
// 없으면 워커 미가동 환경(대부분의 소규모 사이트)에서 config:cache 가 영영 재생성되지
// 않는다. 게다가 CLI 커맨드(plugin:deactivate 등)는 실행 후 프로세스가 종료되어 큐에
// 쌓인 작업을 처리할 주체가 없다. 모든 구독 훅은 sync=true 여야 한다.
$hooks = ExtensionConfigCacheListener::getSubscribedHooks();
foreach ($hooks as $hookName => $config) {
$this->assertArrayHasKey('sync', $config, "{$hookName} 은 sync 플래그가 있어야 합니다 (config 캐시 재생성은 동기 실행 필수).");
$this->assertTrue($config['sync'], "{$hookName} 은 sync=true 여야 합니다 — 큐로 미루면 워커 미가동 시 config 캐시가 재생성되지 않습니다.");
}
}
}