Skip to content

Pass more webview logs to the tauri backend#810

Merged
t-aleksander merged 2 commits intomainfrom
webview-logging
Mar 18, 2026
Merged

Pass more webview logs to the tauri backend#810
t-aleksander merged 2 commits intomainfrom
webview-logging

Conversation

@t-aleksander
Copy link
Contributor

No description provided.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR centralizes error formatting via a new errorDetail() helper and upgrades many catch blocks to log richer diagnostics through Tauri’s backend logger (instead of console.error), plus adds global forwarding for uncaught errors/unhandled rejections.

Changes:

  • Add src/shared/utils/errorDetail.ts and adopt it across the app for consistent error logging.
  • Replace various console.error / JSON.stringify(e) logging with @tauri-apps/plugin-log + errorDetail(...).
  • Add global handlers in src/main.tsx for uncaught errors and unhandled promise rejections; update Biome schema URL.

Reviewed changes

Copilot reviewed 21 out of 21 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/shared/utils/errorDetail.ts New helper to extract a useful debug string from unknown thrown values.
src/shared/hooks/useClipboard.ts Logs clipboard write failures via Tauri logger + errorDetail.
src/shared/components/providers/DeepLinkProvider.tsx Improves deep-link error logging with consistent formatting.
src/pages/enrollment/steps/SendFinishStep/SendFinishStep.tsx Adds structured backend logging for enrollment finish errors.
src/pages/enrollment/steps/MfaSetupStep/MfaSetupStep.tsx Removes console.error and relies on backend logging.
src/pages/enrollment/steps/DeviceStep/components/DesktopSetup/DesktopSetup.tsx Logs enrollment device creation errors with more context.
src/pages/client/pages/ClientSettingsPage/components/GlobalLogs/GlobalLogs.tsx Uses errorDetail when log export fails.
src/pages/client/pages/ClientInstancePage/modals/UpdateInstanceModal/components/UpdateInstanceModalForm.tsx Adds network error handling + more detailed backend logs for enrollment/update flows.
src/pages/client/pages/ClientInstancePage/modals/DeleteInstanceModal/DeleteInstanceModal.tsx Logs delete failures to backend with instance context.
src/pages/client/pages/ClientInstancePage/components/LocationsList/modals/MFAModal/MFAModal.tsx Improves MFA error logs; adds network failure detail handling.
src/pages/client/pages/ClientInstancePage/components/LocationsList/modals/MFAModal/components/MfaMobileApprove/MfaMobileApprove.tsx Logs MFA mobile approval failures with errorDetail.
src/pages/client/pages/ClientInstancePage/components/LocationsList/components/LocationCardRoute/LocationCardRoute.tsx Improves routing toggle error logging.
src/pages/client/pages/ClientInstancePage/components/LocationsList/components/LocationCardConnectButton/LocationCardConnectButton.tsx Improves connect/disconnect error logging.
src/pages/client/pages/ClientEditTunnelPage/modals/DeleteTunnelModal/DeleteTunnelModal.tsx Logs tunnel deletion errors via backend logger.
src/pages/client/pages/ClientEditTunnelPage/components/EditTunnelFormCard.tsx Logs tunnel update failures with errorDetail.
src/pages/client/pages/ClientAddInstancePage/components/AddInstanceFormCard/components/AddInstanceInitForm/AddInstanceInitForm.tsx Adds more detailed logs and error handling in add-instance initialization flow.
src/pages/client/pages/ClientAddInstancePage/components/AddInstanceFormCard/components/AddInstanceDeviceForm/AddInstanceDeviceForm.tsx Adds backend logging for device config save/submit failures.
src/main.tsx Forwards uncaught errors and unhandled rejections to Tauri backend log.
src/components/AutoProvisioningManager.tsx Improves auto-provisioning error logging while avoiding logging full config.
src/components/ApplicationUpdateManager/ApplicationUpdateManager.tsx Improves version-check failure logging with context.
biome.json Updates Biome schema reference URL.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@t-aleksander t-aleksander merged commit 5403ae1 into main Mar 18, 2026
3 checks passed
@t-aleksander t-aleksander deleted the webview-logging branch March 18, 2026 14:02
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.

3 participants