Investigate and plan cookie disappearance bug#1
Conversation
Co-authored-by: michelm.gaming <michelm.gaming@gmail.com>
|
Cursor Agent can help with this pull request. Just |
|
Caution Review failedThe pull request is closed. WalkthroughIntroduces a new "waitForNavigation" action type to differentiate between user-initiated navigation and automatic redirects. The feature adds type definitions, event capture logic that tracks interaction timing, action execution handling, and CLI formatting support across three handlers. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant EventCapture
participant EventQueue
participant ActionExecutor
participant Browser
User->>EventCapture: Click/interact
EventCapture->>EventCapture: Update lastInteractionTime
Browser->>EventCapture: framenavigated event
EventCapture->>EventCapture: Check: time since interaction < 1 sec?
alt Within 1 second
EventCapture->>EventQueue: Emit waitForNavigation
else After 1 second (redirect)
EventCapture->>EventQueue: Emit navigate
end
EventQueue->>ActionExecutor: Process action
alt WaitForNavigation action
ActionExecutor->>Browser: Wait (networkidle2, default timeout)
else Navigate action
ActionExecutor->>Browser: Navigate to URL
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes The changes follow established patterns with straightforward additions: a new type, a new timing-based logic branch in event capture, a new action executor case, and three identical formatter cases across handlers. The core logic is localized and easy to verify against the 1-second interaction threshold requirement. ✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (6)
Comment |
Introduce
waitForNavigationaction type to correctly handle automatic redirects and preserve cookies.This change fixes a bug where login cookies would disappear after a server-side redirect because the runner was performing a redundant
page.goto()for automatic navigations, which would often clear the newly set cookies. The newwaitForNavigationaction type, recorded when a navigation occurs within 1 second of a user interaction, ensures the runner simply waits for the browser's natural navigation to complete, thus preserving session state.Summary by CodeRabbit