Skip to content

CDP 소유자가 떠날 때 비어 있는 리스너를 부르지 않는다 - #782

Merged
yansfil merged 2 commits into
mainfrom
fix/flaky-browser
Oct 8, 2026
Merged

yansfil merged 2 commits into
mainfrom
fix/flaky-browser

Conversation

@yansfil

@yansfil yansfil commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Closes #768

Summary

  • 소유자가 떠나는 페이지를 publishCdp가 알릴 때, 소유자의 세션이 첫 알림에서 구독을 풀고 나면 두 번째 알림은 이미 비어 있는 리스너(this.cdpChanged)를 불러 TypeError로 호스트가 죽었습니다.
  • 알림마다 그 시점에 구독자가 남아 있을 때만 보내도록 했습니다. 소유자의 세션이 알림 하나에서 닫히면 그 뒤에 알릴 상대가 없습니다.

Review

  • 조심해서 볼 파일: desktop/src/main/browser.ts - CDP 소유자 알림 순서가 바뀌는 자리입니다.

Evidence

  • 확인한 것: 새 단위 테스트가 첫 알림에서 구독을 푸는 관찰자를 두고, publishCdp가 던지지 않고 구독이 풀리기 전의 replaced 알림 하나만 보냄을 확인합니다. 수정을 빼면 같은 TypeError로 실패합니다.
  • 확인한 것: desktop 단위 테스트 159개 통과, lint 통과.
  • 확인하지 못한 것: #588은 이 PR이 닫지 않습니다. 재발한 적이 없고 원인을 이름 붙이지 못했습니다.

@yansfil
yansfil merged commit 56306c4 into main Oct 8, 2026
14 checks passed
@yansfil
yansfil deleted the fix/flaky-browser branch October 8, 2026 07:51
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.

Flaky test: browser CDP: the native guard cancels a pending preattach file load and remains restricted after disconnect

1 participant