Repository navigation
fix(transcript): validate the room name even for an empty export - #286
Open
Chihyunpark1 wants to merge 1 commit into
Open
Chihyunpark1 wants to merge 1 commit into
Chihyunpark1 wants to merge 1 commit into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
문제
parseTranscriptExport(src/transcript.ts)는 행마다transcriptRecord(room, value)를 부르며 방 이름 검증을 그 안에 맡깁니다. 행이 없으면 검증이 한 번도 실행되지 않아parseTranscriptExport("BAD ROOM", "")가[]를 반환합니다 — 잘못된 방 이름으로 부른 호출이 빈 결과로 조용히 성공해 호출자 버그를 가립니다.verifyTranscriptRecord가 방 이름의 typeof까지 검사하는 것과 비대칭입니다.부수적으로
transcriptRecord의 방 검사도 정규식 강제 변환에 기대어, 숫자 방 이름123이"123"으로,null이"null"로 테스트돼 문법 안에 들어갑니다.근거
verifyTranscriptRecord는typeof record.room !== "string" || !ROOM_NAME.test(...)로 typeof까지 검사합니다. 같은 검사가 export 진입부에만 없습니다.수정
requireRoomName헬퍼로 뽑아transcriptRecord와parseTranscriptExport진입부 양쪽에서 실행합니다. 오류 메시지는 기존tclk: invalid transcript room …그대로입니다.[Unreleased]Fixed 항목 추가.테스트
[]유지. 비문자열 방 5종이 두 진입부 모두에서 거부되고, 유효 방의transcriptRecord는 기존대로 동작합니다."BAD ROOM"빈 export가 던지지 않습니다(재현 로그 확인).pnpm -r --include-workspace-root build통과,pnpm -r --include-workspace-root test전체 322 passed (root 154, mcp 57+39, flop 72). golden vectors 무변경.