onKeyDown is async and calls await startTimer (~1s network). A second press before that resolves saw the same state (isRunning=false, memRunningEntryId=null) and created a second Notion entry. Only the last startTimer call's ID was tracked, orphaning the first entry running indefinitely in Notion. pendingKeyDown Set acts as a per-action mutex: a second press while the first is in-flight is dropped. try/finally guarantees the lock is always released. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
64 B
64 B