You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Smocket implements namespace connection middleware through io.of(namespace).use(middleware), but the conformance suite does not prove that the middleware is isolated to that namespace.
The gap is listed under Not covered yet in docs/conformance.md: namespace-level io.of(nsp).use(fn) exists, but no case pins it against real Socket.IO.
Proposed change
Add one focused case to the existing src/middleware.test.ts.
The case should:
Register middleware on /admin.
Connect one client to /.
Verify that the middleware has not run.
Connect another client to /admin.
Verify that the middleware has run exactly once.
Use connection completion as the ordering marker. Do not add a timeout to prove that the default-namespace connection skipped the middleware.
No runtime implementation change is required.
Completion:
The case passes with pnpm test:real.
The same case passes with pnpm test:mock.
pnpm conformance has been run and the generated docs/conformance.md change is committed.
pnpm typecheck, pnpm lint, and pnpm format:check pass.
Activity
electrohyun commentedon Aug 10, 2026
🇰🇷 한국어 안내
이 이슈를 해결하기 위해 Smocket의 전체 구현을 이해할 필요는 없습니다.
기존
src/middleware.test.ts에 테스트 하나를 추가합니다./admin에 등록한 미들웨어가 기본 네임스페이스/연결에는 실행되지 않고,/admin연결에서만 정확히 한 번 실행되는지 확인하면 돼요.먼저 실제 Socket.IO 대상으로 테스트하고, 같은 테스트를 Smocket 대상으로 실행합니다. 런타임 구현은 수정하지 않습니다.
테스트 이름을 추가하면 conformance 문서도 함께 갱신해야 해요. 작업 중 예상과 다른 결과가 나오면 편하게 이슈에 남겨주세요.