状態の問い合わせが終わるまでおみくじを引けなくする - #241
Merged
Merged
Conversation
おみくじを引くボタンを押して演出(matter.js)が始まった直後に、引く前の画面へ 戻される。リロードではなく Vue の状態が上書きされている。 保存済みの状態で通信を待たずに画面を出すようにした(#236)結果、peek の応答が 返る前からボタンが押せる。押すと state が animating になるが、その後に到着した peek の応答が applyResponse で state を available/cooldown に戻すため、演出が 畳まれて元の画面に戻っていた。 - 問い合わせが1度でも完了するまでボタンを disabled にする(statusChecked)。 確認中であることも表示する - 演出中に届いた peek の応答は state を触らない(抽選側が状態を持っている) - 演出中にクールダウンが明けたときのタイマーも state を触らない - startScene の入口でも確認前は止める Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
「今 animating か」で応答を捨てると、演出が結果より先に終わったときの取り直し (onLanded)を潰してしまう。あの経路はまだ animating のまま fetchStatus を呼ぶため、 応答を捨てると演出が閉じずに固まる(直そうとしたバグより悪い)。 sceneCount の世代を要求時に控え、応答時に変わっていたら捨てる。マウント時の 問い合わせの応答だけが捨てられ、onLanded からの取り直しは通る。 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
kojira
pushed a commit
that referenced
this pull request
Aug 20, 2026
kojira
pushed a commit
that referenced
this pull request
Aug 20, 2026
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.
症状
おみくじを引くボタンを押して演出(matter.js)が始まった直後に、引く前の画面へ戻される。
毎回起きる。
原因
リロードではなく、Vue の状態が上書きされている。
#236 で「保存済みの状態を通信を待たずに表示する」ようにした結果、
peekの応答が返る前からボタンが押せるようになっていた。
state = "available"→ ボタンが押せるfetchStatus()(トークン取得 +peek)はまだ飛行中state = "animating"→ 演出(画面B)applyResponseがstateをavailable/cooldownに戻す→ 演出が畳まれて画面Aへ
変更
disabledにする(statusChecked)。確認中であることも表示する(ご要望どおりの対処)
peekの応答はstateを触らない(抽選側が状態を持っているため)stateを触らないstartSceneの入口でも確認前は止める(ボタンのdisabledと二重の守り)peekの応答を無視するだけでも症状は消えるが、確認前に押せてしまうこと自体がおかしいので、要望どおり押せなくするのを主とし、残りは同じ競合の別経路を塞ぐもの。
検証
yarn generate通過。再現手順(修正前): おみくじページを一度引いた状態で開き直し、
availableが出た瞬間に素早く「おみくじを引く」を押すと、演出が始まってすぐ元の画面に戻る。修正後はボタンが押せず、問い合わせ完了後に押せるようになる。
Co-Authored-By: Claude Opus 5 noreply@anthropic.com
Generated by Claude Code