mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-07-18 00:46:45 +00:00
* fix(plugin-oauth): surface real error and propagate state on local errors Clicking "Connect Google Account" could show the generic "Authentication failed!" snack with no detail. Two issues caused this: 1. The catch in connectOAuth swallowed the actual error. Log it and include the message in the snack so failures are diagnosable. 2. When the Electron main process emitted a local OAuth error (invalid_auth_url, failed_to_open_browser), the IPC payload had no state, and handleRedirectError silently dropped any callback whose state did not match. Echo the state from the auth URL on the main side, and treat missing-state errors as trusted local failures on the renderer side (they are not CSRF-relevant). This rejects the pending flow immediately instead of waiting for the 5-minute timeout. * fix(plugin-oauth): apply review feedback on connect-OAuth UX - Split the try block in connectOAuth so a failure of _loadDynamicOptions no longer surfaces as an "Authentication failed" snack on top of the success snack. The OAuth connection itself succeeded; loadOptions has its own per-field error reporting. - Sanitize the surfaced error: collapse whitespace and cap to 200 chars so a long HttpErrorResponse message doesn't blow up the snack. - Log the message field instead of the raw Error, per CLAUDE.md anti-pattern #11 (log history is exportable). - Use undefined instead of null for the state echo in the main process to match the renderer/preload signatures. --------- Co-authored-by: Claude <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| assets/icons | ||
| ipc-handlers | ||
| scripts | ||
| shared-with-frontend | ||
| task-widget | ||
| wayland-idle-helper | ||
| backup.ts | ||
| clear-stale-idb-locks.ts | ||
| clipboard-image-handler.ts | ||
| common.const.ts | ||
| CONFIG.ts | ||
| debug.ts | ||
| electronAPI.d.ts | ||
| error-handler-with-frontend-inform.ts | ||
| full-screen-blocker.ts | ||
| gpu-startup-guard.ts | ||
| idle-time-handler.ts | ||
| indicator.test.cjs | ||
| indicator.ts | ||
| ipc-handler-wrapper.ts | ||
| ipc-handler.ts | ||
| jira.ts | ||
| local-file-sync.ts | ||
| local-rest-api.ts | ||
| lockscreen.ts | ||
| main-window.ts | ||
| main.ts | ||
| plugin-node-executor.ts | ||
| plugin-oauth.ts | ||
| preload.ts | ||
| protocol-handler.ts | ||
| proxy-agent.ts | ||
| shared-state.ts | ||
| simple-store.test.cjs | ||
| simple-store.ts | ||
| start-app.ts | ||
| tsconfig.electron.json | ||
| various-shared.ts | ||