fix: case-open popup re-appears after the case is closed#605
Conversation
|
Hey @mvanhorn, thanks for digging into this! 😄 Funny timing — we both went after #598 at basically the same moment today; your PR and #606 landed within a couple of hours of each other. Quick note on how the two relate, so we don't accidentally double-merge: Your change is a neat minimal mitigation: by not resetting the cooldown on close, the flapping re-open gets throttled by the existing 10s window, which knocks out the "popup comes back" symptom. #606 goes after the root cause. I pulled live BLE captures (the reporter's AirPods Pro 1 log + my own Pro 3) and the lid state is genuinely oscillating: when one pod is out of the case, the out-of-case pod broadcasts a frame whose lid byte is stale and decodes to a phantom OPEN even while the case is shut — interleaved ~1:1 with the correct in-case frames. So the effective lid flaps OPEN↔CLOSED and keeps re-triggering the popup. #606 stops trusting that frame (only in-case / both-in-case frames drive the lid state), which also fixes the "sometimes won't dismiss" half of the report and the same phantom that was feeding auto-connect's Because of that, the two touch the same cooldown logic in opposite directions — yours preserves the cooldown across a close, #606 keeps the reset but removes the flapping at the source — so they're really alternative fixes rather than complementary, and we'd want to pick one. Would you be up for reviewing #606? You clearly know this corner of the code now, and a second pair of eyes on the decoder change would be very welcome. Either way, thanks a lot for the contribution and sorry for the collision! |
@mvanhorn independently fixed #598 in #605 by no longer resetting the case cooldown on close, throttling the re-pop. We cherry-picked that commit above to keep his authorship/credit, but this PR instead removes the underlying lid-state flapping at its source (out-of-case pod's stale lid byte -> UNKNOWN), so the cooldown can keep resetting on close and a genuine close->reopen still shows the popup. Reverting his change here so the two approaches don't stack; thanks @mvanhorn for the parallel work.
@mvanhorn independently fixed #598 in #605 by no longer resetting the case cooldown on close, throttling the re-pop. We cherry-picked that commit above to keep his authorship/credit, but this PR instead removes the underlying lid-state flapping at its source (out-of-case pod's stale lid byte -> UNKNOWN), so the cooldown can keep resetting on close and a genuine close->reopen still shows the popup. Reverting his change here so the two approaches don't stack; thanks @mvanhorn for the parallel work.
|
Superseded by #606, which is now merged. To make sure your work isn't lost, I cherry-picked your commit into #606, so your fix is preserved on #606 ended up going the root-cause route (the out-of-case pod's stale lid byte was making the lid flap), which also covers the "won't dismiss" half of the report and the same glitch that was feeding auto-connect. Closing this one since that landed — but thank you again for jumping on #598 so quickly, and please keep the contributions coming! |
|
Case-open popup works flawlessly as of v5.1.7-rc0! -blipsodaacumen (Formerly: lilnug143) |
Summary
The case-open popup no longer re-appears after the case has been closed, fixing the inconsistency lilnug143 reported in #598. The popup decision logic in
PopUpReaction.kttreated a case-close event as a full reset, so residual lid-state updates arriving after close could re-trigger the popup within the same session. Closing now hides the popup without resetting the cooldown, and the cooldown window has to genuinely elapse before a new open shows it again.Why this matters
#598 describes the popup randomly coming back after putting the AirPods case away, which makes the reaction feature feel broken precisely at the moment the user is done with it. The two-line logic change keeps the existing show-on-open behavior intact; only the close path changes.
Testing
Extended
PopUpReactionLogicTestwith the residual-open-after-close case (popup stays hidden, cooldown preserved) and the cooldown-expiry case (a real re-open after the window shows the popup again). Gradle was not runnable on this host (no JVM); CI covers the build and the new tests.AI was used for assistance.
Fixes #598