chore(client): use Sentry User Feedback API for client feedback#2739
chore(client): use Sentry User Feedback API for client feedback#2739fortuna wants to merge 15 commits into
Conversation
Updates the `SentryErrorReporter.report` method in the web client to utilize Sentry's `captureUserFeedback` API, passing the required `eventId` from the captured event and including the user's name, email, and comments. This correctly integrates with Sentry's User Feedback system, removing the old workaround that redundantly captured an event, configured the global scope, captured a message, and cleared the scope. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
Updates the `SentryErrorReporter.report` method in the web client to utilize Sentry's `captureUserFeedback` API, passing the required `eventId` from the captured event and including the user's name, email, and comments. This correctly integrates with Sentry's User Feedback system, removing the old workaround that redundantly captured an event, configured the global scope, captured a message, and cleared the scope. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Updates the `SentryErrorReporter.report` method in the web client to utilize Sentry's `captureUserFeedback` API, passing the required `eventId` from the captured event and including the user's name, email, and comments. This correctly integrates with Sentry's User Feedback system, removing the old workaround that redundantly captured an event, configured the global scope, captured a message, and cleared the scope. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Updates the `SentryErrorReporter.report` method in the web client to utilize Sentry's `captureUserFeedback` API, passing the required `eventId` from the captured event and including the user's name, email, and comments. This correctly integrates with Sentry's User Feedback system, removing the old workaround that redundantly captured an event, configured the global scope, captured a message, and cleared the scope. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Ensure that the Sentry scope is properly configured with the relevant tags and user email before calling the new Sentry User Feedback API (`captureUserFeedback`), and clear the scope after submission, restoring parity with the original method's context-setting logic. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Migrate feedback reporting logic to use Sentry v10 captureFeedback and modernize Electron base requirements.
Ensure that the Sentry scope is properly configured with the relevant tags and user email before calling the new Sentry User Feedback API (`captureUserFeedback`), and clear the scope after submission, restoring parity with the original method's context-setting logic. Fix lint issues in `error_reporter.ts` by using inline type imports. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Ensure that the Sentry scope is properly configured with the relevant tags and user email before calling the new Sentry User Feedback API (`captureUserFeedback`), and clear the scope after submission, restoring parity with the original method's context-setting logic. Fix lint issues in `error_reporter.ts` by using inline type imports. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR switches client/manager “Contact us” submissions from a custom Sentry event hack to Sentry’s dedicated User Feedback capture API, and upgrades the Sentry + Electron stack to support that.
Changes:
- Replace
Sentry.captureEvent(...)usage withSentry.captureFeedback(...)across Manager and Client feedback flows. - Upgrade Sentry SDKs and Electron (and related build tooling) to newer versions; explicitly set
sandbox: falseto preserve prior behavior. - Move renderer breadcrumb URL redaction into the renderer’s
Sentry.init({ beforeBreadcrumb })rather than exposing a redaction helper from preload.
Reviewed changes
Copilot reviewed 15 out of 16 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| server_manager/www/ui_components/outline-contact-us-dialog.ts | Switch Manager contact-us dialog submission to captureFeedback. |
| server_manager/www/app.ts | Add renderer-side breadcrumb URL redaction and switch feedback submit handler to captureFeedback. |
| server_manager/package.json | Upgrade Sentry/Electron dependencies and bump Puppeteer Chromium revision. |
| server_manager/electron/util.ts | Make URL redaction helper rely on global URL (no Node url import). |
| server_manager/electron/preload.ts | Remove Sentry preload import and remove renderer-exposed redaction function. |
| server_manager/electron/index.ts | Explicitly disable sandbox and tighten event typing for will-navigate. |
| client/web/views/contact_view/index.ts | Update contact view to call sendFeedback (renamed reporter API). |
| client/web/views/contact_view/index.spec.ts | Update tests to assert sendFeedback usage. |
| client/web/shared/error_reporter.ts | Rename reporter API to sendFeedback and use Sentry feedback capture + updated integrations API. |
| client/web/app/main.electron.ts | Update IPC event typings, use captureFeedback, and handle main() rejection. |
| client/web/app/main.cordova.ts | Update Cordova reporter to call sendFeedback and keep native log reporting hook. |
| client/src/cordova/build.action.mjs | Allow Xcode provisioning updates in release builds. |
| client/package.json | Upgrade Sentry/Electron versions to match new feedback API usage. |
| client/electron/preload.ts | Remove Sentry preload import. |
| client/electron/index.ts | Explicitly disable sandbox and refactor will-navigate handler. |
Comments suppressed due to low confidence (2)
client/web/app/main.cordova.ts:70
reportEventsis called withSentry.lastEventId() || ''. After switchingsendFeedbacktocaptureFeedback,lastEventId()may be empty/unchanged, and passing an empty string causes the native Android/iOS plugins to taguser_event_idwith''(hurting de-duplication/cross-referencing). Consider ensuring a non-empty identifier (e.g., use the event id returned/created by Sentry for this feedback, or generate a UUID fallback) rather than''.
await super.sendFeedback(message, feedbackCategory, userEmail);
// Sends previously captured logs and events to the error reporting framework.
// Associates the report to the provided unique identifier.
await pluginExec<void>('reportEvents', Sentry.lastEventId() || '');
}
server_manager/electron/preload.ts:25
- The preload script no longer exposes
redactSentryBreadcrumbUrlviacontextBridge, butserver_manager/types/preload.d.tsstill declares it as available in the renderer. This mismatch can let renderer code compile against an API that doesn’t exist at runtime. Update/remove the corresponding declaration (or re-expose the function) to keep the preload contract accurate.
import type {HttpRequest, HttpResponse} from '@outline/infrastructure/path_api';
import {contextBridge, ipcRenderer} from 'electron';
import * as digitalocean_oauth from './digitalocean_oauth';
import * as gcp_oauth from './gcp_oauth';
contextBridge.exposeInMainWorld(
'fetchWithPin',
(request: HttpRequest, fingerprint: string): Promise<HttpResponse> =>
ipcRenderer.invoke('fetch-with-pin', request, fingerprint)
);
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ohnorobo
left a comment
There was a problem hiding this comment.
It looks like this has some issues with the Linux/Windows CI
I think this is a good change, but I worry about the chance of the electron upgrade introducing some new difficult-to-debug/platform-specific-interaction bug, particularly when we don't have QA testing to thoroughly check. So I would like to hold back on merging something like this until after we've finished a clean cross-platform 1.20.0 release.
| 'archive', | ||
| '-configuration', | ||
| 'Release', | ||
| '-allowProvisioningUpdates', |
|
I moved the manager change to #2743, so we can submit that without touching the client. |
Replaces the multi-step "Contact Us" dialog with the existing simple Feedback dialog, which submits via Sentry.captureFeedback. Email/ticket support is no longer offered, so the elaborate triage wizard is dead weight. Also drops the now-unused contactView feature flag and the success/error toast helpers that only the Contact Us flow wired up. Adds a TODO on the cross-platform client's contact-us view noting it should be removed entirely once #2739 merges. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Replaces the multi-step "Contact Us" dialog with the existing simple Feedback dialog, which submits via Sentry.captureFeedback. Email/ticket support is no longer offered, so the elaborate triage wizard is dead weight. Also drops the now-unused contactView feature flag and the success/error toast helpers that only the Contact Us flow wired up. Adds a TODO on the cross-platform client's contact-us view noting it should be removed entirely once #2739 merges. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
I moved away from hacking the event reporting feature to using the proper user feedback feature.
At first, I was forced to use a deprecated method, so I upgraded Sentry to latest. That in turn forced me to upgrade Electron to 23+, so I upgraded to 30. See https://www.electronjs.org/docs/latest/breaking-changes for info.
I had to explicitly disable the sandbox to match the previous default behavior, but we should get rid of that eventually.
I tested by submitting feedback in the Manager and Client on macOS.