Skip to content

fix(web): convert pop up error as cancellation#1516

Merged
tyler-dane merged 11 commits intomainfrom
cursor/posthog-error-investigation-7e18
Mar 7, 2026
Merged

fix(web): convert pop up error as cancellation#1516
tyler-dane merged 11 commits intomainfrom
cursor/posthog-error-investigation-7e18

Conversation

@tyler-dane
Copy link
Copy Markdown
Contributor

Fixes "Error: Popup window closed" in Posthog by treating Google OAuth popup cancellations as benign user actions instead of errors.


Open in Web Open in Cursor 

@cursor
Copy link
Copy Markdown
Contributor

cursor Bot commented Mar 7, 2026

You have run out of free Bugbot PR reviews for this billing cycle. This will reset on April 6.

To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

@tyler-dane
Copy link
Copy Markdown
Contributor Author

@cursoragent fix test failures

@cursor
Copy link
Copy Markdown
Contributor

cursor Bot commented Mar 7, 2026

Fixed the test failures. The tests were using synchronous queries (getByRole, getByText) that throw immediately if elements aren't found, but the component may not be fully rendered yet.

Changes Made

I updated the failing tests in packages/web/src/views/Day/view/DayView.route.test.tsx to use asynchronous queries that wait for elements to appear:

  1. "should update URL when navigating to next day" - Changed getByRole to findByRole with await
  2. "should update URL when navigating to previous day" - Changed getByRole to findByRole with await
  3. "should display correct date in header when viewing specific date" - Changed getByText to findByText with await

This addresses timing issues in CI where elements weren't immediately available after render. All tests now pass locally (195 test suites, 1543 tests), and the changes have been committed and pushed to the branch.

Open in Web Open in Cursor 

@tyler-dane tyler-dane changed the title Posthog error investigation fix(web): convert pop up error as cancellation Mar 7, 2026
Comment thread packages/web/src/components/oauth/google/useGoogleLogin.ts Outdated
cursoragent and others added 3 commits March 6, 2026 20:57
Co-authored-by: Tyler Dane <tyler-dane@users.noreply.github.com>
Replace getByRole/getByText with findByRole/findByText to wait for
components to render before assertions. This fixes timing-related test
failures in CI where elements weren't immediately available after render.

Co-authored-by: Tyler Dane <tyler-dane@users.noreply.github.com>
- Removed unused import from promise.middleware.test.ts to improve clarity.
- Simplified condition in sendResponse function of promise.middleware.ts for better readability.
- Updated import path for Google OAuth error utility in useGoogleLogin.ts to reflect new directory structure.
@tyler-dane tyler-dane force-pushed the cursor/posthog-error-investigation-7e18 branch from fcb7eb7 to e8137bb Compare March 7, 2026 04:57
Comment thread packages/web/src/auth/google/google-oauth-error.util.test.ts Outdated
… file

- Adjusted the import statement in `google-oauth-error.util.test.ts` to reflect the new directory structure for better organization and clarity.
- Eliminated console log statements from data and external migration functions to reduce clutter and improve performance.
- Updated the demo data seed migration to skip seeding when existing data is present, enhancing efficiency.
- Added console method spies in test files to control logging behavior during tests, improving test clarity and reducing noise.
- Deleted the `google-oauth-preview.png` and `logo.png` files from the assets directory as they are no longer needed, streamlining the asset management.
- Replaced synchronous rendering methods with asynchronous counterparts in various test files to ensure proper initialization and avoid timing issues.
- Updated utility functions to prepare storage for tests, enhancing the clarity and reliability of the test environment.
- Removed unused imports and streamlined test setups across multiple components, improving overall code organization and readability.
- Changed the test command in package.json from "cross-env-shell" to "cross-env" for improved compatibility and consistency across environments.
- Updated the DraggableTask component to conditionally enable the drag handle based on the number of tasks, enhancing user experience.
- Refactored the floating behavior to only activate when the drag handle is visible and not in test environments, improving performance and reliability.
- Simplified the reference setting logic for the floating element, ensuring it only attaches when necessary.
Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Comment thread packages/web/src/views/Day/components/Task/DraggableTask.tsx Outdated
- Introduced a new setup file to mock @floating-ui/react, allowing tests to run without real layout calculations.
- Updated TaskContextMenu and TaskList test files to include the new floating-ui mock, ensuring consistent behavior across tests.
- Simplified the DraggableTask component by removing environment checks for floating behavior, enhancing test reliability.
@tyler-dane tyler-dane merged commit b0b43c3 into main Mar 7, 2026
9 checks passed
@tyler-dane tyler-dane deleted the cursor/posthog-error-investigation-7e18 branch March 7, 2026 07:48
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