[CrashReporting] Enable http_retry, harden symbol upload, fix NSIS context

Sets sentry_options_set_http_retry so the cache_keep-held crash
envelope in Ask mode is written with a retry filename and actually
flushes on giveConsent() instead of sitting in <db>/cache until
pruning.

Adds continue-on-error to both sentry-cli install steps so a Sentry
registry outage or broken Git Bash install cannot block release
assets.

Cleans the legacy WER CrashDumps folder under SetShellVarContext
current (under all it resolves to ProgramData, not the user's
AppData) in installer and uninstaller; registry delete works in
either context.
This commit is contained in:
Lukas Brübach 2026-10-16 20:00:18 +02:00
parent c40763e61d
commit c00a08a8b6
3 changed files with 19 additions and 3 deletions

View file

@ -270,6 +270,9 @@ jobs:
- name: "Install sentry-cli" - name: "Install sentry-cli"
if: matrix.package != 'skip' && needs.configure.outputs.tag != null if: matrix.package != 'skip' && needs.configure.outputs.tag != null
# Downloads from Sentry's release registry: a Sentry outage or a broken install under
# Git Bash must not take down the release assets below.
continue-on-error: true
shell: bash shell: bash
env: env:
SENTRY_CLI_VERSION: '3.8.0' SENTRY_CLI_VERSION: '3.8.0'
@ -621,6 +624,9 @@ jobs:
- name: "Install sentry-cli" - name: "Install sentry-cli"
if: needs.configure.outputs.tag != null && matrix.make_package == '1' if: needs.configure.outputs.tag != null && matrix.make_package == '1'
# Same as the Linux leg above: the install downloads from Sentry's registry, so a
# failure here must not block the release upload below.
continue-on-error: true
shell: bash shell: bash
env: env:
SENTRY_CLI_VERSION: '3.8.0' SENTRY_CLI_VERSION: '3.8.0'

View file

@ -1539,9 +1539,13 @@ ${If} $PortableMode = 0
; Older installers did register cockatrice.exe above (and the removed ; Older installers did register cockatrice.exe above (and the removed
; MiniDumpWithFullMemory writer filled that folder), and that key survives this ; MiniDumpWithFullMemory writer filled that folder), and that key survives this
; install, so WER would keep writing full dumps. Remove it, and clear the ; install, so WER would keep writing full dumps. Remove it, and clear the
; legacy dumps nothing consumes anymore. ; legacy dumps nothing consumes anymore. $LOCALAPPDATA resolves per shell context:
; under "all" it points at ProgramData, so switch to "current" for the per-user
; dumps folder and back afterwards; the registry delete works in either context.
DeleteRegKey HKLM "Software\Microsoft\Windows\Windows Error Reporting\LocalDumps\cockatrice.exe" DeleteRegKey HKLM "Software\Microsoft\Windows\Windows Error Reporting\LocalDumps\cockatrice.exe"
SetShellVarContext current
RMDir /r "$LOCALAPPDATA\CrashDumps\Cockatrice" RMDir /r "$LOCALAPPDATA\CrashDumps\Cockatrice"
SetShellVarContext all
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice" "DisplayIcon" "$INSTDIR\cockatrice.exe" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice" "DisplayIcon" "$INSTDIR\cockatrice.exe"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice" "DisplayName" "Cockatrice" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice" "DisplayName" "Cockatrice"
@ -1644,9 +1648,12 @@ Section "un.Application" UnSecApplication
; Leftover WER LocalDumps key from pre-Sentry installers (see the installer note ; Leftover WER LocalDumps key from pre-Sentry installers (see the installer note
; above): removing it here covers machines that uninstall without reinstalling. ; above): removing it here covers machines that uninstall without reinstalling.
; The legacy full-memory dumps go with it; nothing consumes them anymore. ; The legacy full-memory dumps go with it; nothing consumes them anymore. Same shell
; context note as the installer: the per-user dumps folder needs "current".
DeleteRegKey HKLM "Software\Microsoft\Windows\Windows Error Reporting\LocalDumps\cockatrice.exe" DeleteRegKey HKLM "Software\Microsoft\Windows\Windows Error Reporting\LocalDumps\cockatrice.exe"
SetShellVarContext current
RMDir /r "$LOCALAPPDATA\CrashDumps\Cockatrice" RMDir /r "$LOCALAPPDATA\CrashDumps\Cockatrice"
SetShellVarContext all
; Only remove the file/protocol associations if we registered them (i.e. the ; Only remove the file/protocol associations if we registered them (i.e. the
; install was not portable) and .cod is still owned by Cockatrice, so we don't ; install was not portable) and .cod is still owned by Cockatrice, so we don't

View file

@ -270,9 +270,12 @@ void CrashReporter::init(const QString &dsn,
// crash envelope in <database>/cache instead of dropping it at init, so the Ask dialog // crash envelope in <database>/cache instead of dropping it at init, so the Ask dialog
// decides its fate: giveConsent() flushes it via the transport retry, revokeConsent() // decides its fate: giveConsent() flushes it via the transport retry, revokeConsent()
// deletes it below. This also covers the first crash after switching to AlwaysSend, // deletes it below. This also covers the first crash after switching to AlwaysSend,
// which giveConsent() (running after init) would otherwise miss. // which giveConsent() (running after init) would otherwise miss. http_retry is required
// for the flush: without it the held envelope is written with a plain filename the retry
// scanner skips, and giveConsent()'s sentry_transport_retry() sends nothing.
sentry_options_set_require_user_consent(options, 1); sentry_options_set_require_user_consent(options, 1);
sentry_options_set_cache_keep(options, SENTRY_CACHE_KEEP_OFFLINE); sentry_options_set_cache_keep(options, SENTRY_CACHE_KEEP_OFFLINE);
sentry_options_set_http_retry(options, 1);
sentry_options_set_before_send(options, scrubEventBeforeSend, nullptr); sentry_options_set_before_send(options, scrubEventBeforeSend, nullptr);
ready = (sentry_init(options) == 0); ready = (sentry_init(options) == 0);
#else #else