Skip to content

Fix Oura login and Electron activation crash - #10

Open
seddm-sketch wants to merge 1 commit into
EIrno:mainfrom
seddm-sketch:codex/fix-oura-login-electron-activate
Open

seddm-sketch wants to merge 1 commit into
EIrno:mainfrom
seddm-sketch:codex/fix-oura-login-electron-activate

Conversation

@seddm-sketch

@seddm-sketch seddm-sketch commented Jun 11, 2026

Copy link
Copy Markdown

Summary

Fixes two runtime issues found while using the packaged macOS app:

  • The Oura login automation failed when the authentication choice screen showed both “Use passkey” and “Email me a code”.
  • The Electron app could crash on macOS activation because mainWindow.show() was called before mainWindow had been initialized.

Root Cause

Oura’s auth screen now renders multiple button[name="selectedId"] buttons. The login automation used that broad locator directly, which caused Playwright strict mode to fail because it matched both the passkey and email-code buttons.

Electron also declared mainWindow without an initial value. On macOS, the activate event can fire while mainWindow is still undefined, causing an uncaught exception when calling .show().

Changes

  • Explicitly select the email-code authentication button using accessible button text, with a fallback to the outlined selectedId button.
  • Use .first for OTP input locators to avoid strict-mode ambiguity.
  • Initialize mainWindow to null.
  • Add a shared showOrCreateWindow() helper for macOS activation and tray open actions.

Verification

  • Confirmed Oura email-code login proceeds past the auth choice screen.
  • Rebuilt the macOS DMG and confirmed the app opens without the previous uncaught Electron exception.
  • Ran:
python3 -m compileall backend/src/automation.py
cd frontend && npx tsc -p electron/tsconfig.json

@seddm-sketch
seddm-sketch marked this pull request as ready for review June 11, 2026 16:24
@seddm-sketch
seddm-sketch marked this pull request as draft June 11, 2026 16:29
@seddm-sketch
seddm-sketch marked this pull request as ready for review June 11, 2026 16:30
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