Skip to content

fix(publish): give the recovery panel its own token field - #752

Merged
Eomdahyeon merged 2 commits into
mainfrom
fix/issue-749-recovery-panel-keeps-token
Oct 5, 2026
Merged

Eomdahyeon merged 2 commits into
mainfrom
fix/issue-749-recovery-panel-keeps-token

Conversation

@Eomdahyeon

Copy link
Copy Markdown
Collaborator

Closes #749

문제

게시 자격 증명을 요청에서 받는 배포(publish_credential: request)에서 복구 패널의 원격 확인은 토큰이 다시 필요하다. 패널은 "위에 토큰을 다시 입력하라"고 안내했는데, 페이지의 토큰 칸은 값이 바뀌면 게시 폼을 처음으로 되돌린다(setConfirmation(undefined); publish.reset()). 패널은 바로 그 두 상태에 걸려 있어서, 안내를 따르면 패널이 사라지고 남는 것은 원격을 보지 않는 기록 초기화뿐이었다. #744 에서 제가 넣은 결함이다.

변경

  • features/publish/PublishRecoveryPanel.tsx
    • needsCredential 일 때 패널 안에 자체 토큰 칸을 둔다. 페이지의 토큰과 같은 규칙이다: 메모리에만 두고, 원격 확인 한 번에 실어 보낸 뒤 바로 비운다. 헤더에 실을 수 없는 값이면 버튼을 막고 보내지 않는다.
    • 기록 초기화는 토큰을 보내지도 소모하지도 않는다. Builder 의 reset 은 원격을 읽지 않는다(publish_api.py 의 reset_publish_receipt 본문에 자격 증명을 쓰는 곳이 없다 — 코드를 읽어 확인했고 실제 Builder 로 돌려 보지는 않았다).
    • takeCredential prop 은 없앴다.
  • pages/BuildPublishPage.tsx: takePublishCredential 제거. 페이지의 토큰 칸과 게시 흐름은 그대로다.
  • 문구(ko/en): 패널 토큰 칸의 라벨·설명을 더하고, 안내를 "바로 위 칸에 입력"으로 고쳤다.
  • CHANGELOG.

이슈가 제시한 두 방법 중 "패널에 자체 토큰 칸"을 골랐다. 다른 쪽(토큰이 바뀌어도 publish_state_unknown 상태 유지)은 페이지 토큰 칸의 기존 규칙 — 토큰이 바뀌면 준비 상태를 다시 확인한다(#615) — 과 얽힌다.

테스트 (__tests__/publishRecovery.test.tsx)

  • 페이지 수준(이슈가 요구한 것): 게시 → publish_state_unknown → 토큰 없이 원격 확인은 나가지 않고 안내만 → 패널의 칸에 토큰 입력 후에도 패널이 남아 있음 → 원격 확인이 그 토큰을 헤더에, destination 을 본문에 실어 한 번 나감 → confirmed 표시, 재게시 버튼 없음, 토큰은 storage 에 없음.
  • 패널: 자격 증명을 서버가 가진 배포에서는 칸이 없다 / 토큰은 한 요청 뒤 비워지고 두 번째 확인은 토큰 없이 나가지 않는다 / 형식이 틀린 토큰은 보내지 않는다 / reset 은 헤더 없이 DELETE 로 나가고 입력한 토큰은 칸에 남는다.

검증

  • npx vitest run __tests__/publishRecovery.test.tsx → Tests 18 passed (18).
  • publish·locale 관련 8개 파일 → Tests 131 passed (131).
  • npx tsc --noEmit, eslint 출력 없음.
  • 전체 스위트는 로컬에서 돌리지 않았다 — CI 에 맡긴다.
  • 브라우저에서 보지 않았다. 새 칸의 배치와 문구는 test(publish): look at the publish recovery panel in a browser against a real Builder #748 의 화면 확인 범위에 들어간다.

남는 것

사용자가 복구 패널이 떠 있는 동안 페이지의 토큰 칸이나 destination 을 바꾸면 패널은 여전히 사라진다(게시 폼을 처음으로 되돌리는 기존 동작). 기록은 Builder 에 남아 있으므로 같은 게시를 다시 실행하면 publish_state_unknown 과 함께 패널이 돌아오지만, 그 경로를 테스트로 고정하지는 않았다.

🤖 Generated with Claude Code

Checking the remote needs the publish token again in a deployment that takes
the credential from the request. The panel pointed at the page's token field,
but a change there resets the publish form and the failure the panel hangs
on, so the panel disappeared and only the blind reset was left. Ask for the
token inside the panel, use it for one remote check, and send a reset without
it.

Closes #749

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@yeongseon yeongseon left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

diff 를 읽었고 CLEAN 이라 승인합니다. 이번에는 패널뿐 아니라 그것을 쓰는 페이지의 흐름까지 읽었습니다.

  • 페이지 수준 테스트가 #749 의 경로를 그대로 탑니다: 게시 → publish_state_unknown → 토큰 없이 원격 확인은 나가지 않음 → 패널의 칸에 토큰을 넣어도 패널이 남아 있음 → 원격 확인이 그 토큰을 헤더에 실어 한 번 나감.
  • reset 은 토큰을 보내지도 소모하지도 않습니다. Builder 의 reset 이 원격을 읽지 않는다는 근거도 적혀 있습니다.
  • 토큰은 한 요청 뒤 비워지고, storage 에 남지 않는 것을 테스트가 확인합니다.

본문이 남긴 것 — 패널이 떠 있는 동안 페이지의 토큰 칸이나 destination 을 바꾸면 패널이 사라진다 — 은 기존 동작이고, 같은 게시를 다시 실행하면 돌아옵니다. 지금은 그대로 두고, 화면 확인(#748)에서 어색하면 그때 다룹니다.

@Eomdahyeon
Eomdahyeon merged commit 48e85e0 into main Oct 5, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(publish): entering the publish token removes the recovery panel that asked for it

2 participants