Skip to content

fix(common): require an explicit yes before overwriting config - #277

Merged
funa-tk merged 1 commit into
DeNA:masterfrom
toku-sa-n:fix/config-overwrite-require-yes
Nov 5, 2026
Merged

funa-tk merged 1 commit into
DeNA:masterfrom
toku-sa-n:fix/config-overwrite-require-yes

Conversation

@toku-sa-n

Copy link
Copy Markdown
Contributor

PacketProxyHubから設定をダウンロードするとき、ConfigHttpServer は「設定を上書きしますか?」と確認しますが、「いいえ」(NO_OPTION)のときだけ拒否していました。そのため、ダイアログをEscや閉じるボタンで閉じた場合(CLOSED_OPTION)は、拒否したつもりでも既存の設定が消され、受け取った設定で上書きされていました。

「はい」(YES_OPTION)のとき以外はすべて拒否(401)するように変えました。ダイアログを閉じた場合は、今の設定がそのまま残ります。

確認したこと

  • ./gradlew compileJava test と spotlessCheck が通ることを確認しました。

  • 単体テストは追加していません。この判定は ConfigHttpServer の中で Swing の確認ダイアログを直接呼んでいて、今の構造ではテストから差し替えられないためです。

  • By placing an "x" in the box, I hereby understand, accept and agree to be bound by the terms and conditions of the Contribution License Agreement.

🤖 Generated with Claude Code

When PacketProxyHub pushes a config, ConfigHttpServer asks the user to
confirm the overwrite, but it only rejected NO_OPTION. Closing the dialog
with Esc or the close button returns CLOSED_OPTION, which fell through,
dropped the existing config and imported the remote one. Treat anything
other than YES_OPTION as a refusal, so dismissing the dialog keeps the
current config.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@toku-sa-n
toku-sa-n marked this pull request as ready for review November 5, 2026 10:32
@funa-tk

funa-tk commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

ありがとうございます。

@funa-tk
funa-tk merged commit 857f678 into DeNA:master Nov 5, 2026
1 check 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.

2 participants