mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-08 02:53:25 -08:00
[CrashReporting] Forward mode changes to SDK and fix Linux CI opt-in
Connects PersonalSettings::crashReportingModeChanged to giveConsent()/revokeConsent() so switching from AlwaysSend to NeverSend (or Ask) mid-session reaches the SDK instead of leaving consent given until restart. Forwards WITH_CRASH_REPORTING into the docker container the way CCACHE_DIR is, so the Linux package leg actually builds with crash reporting ON instead of silently building OFF.
This commit is contained in:
parent
6411abfb57
commit
4d790ff388
2 changed files with 18 additions and 0 deletions
|
|
@ -175,6 +175,12 @@ function RUN ()
|
|||
args+=(--mount "type=bind,source=$GITHUB_OUTPUT,target=/gh_output")
|
||||
args+=(--env "GITHUB_OUTPUT=/gh_output")
|
||||
fi
|
||||
# The container does not inherit host env vars: without this, WITH_CRASH_REPORTING=ON set in
|
||||
# the workflow never reaches compile.sh inside the container, so the Linux packages silently
|
||||
# build with crash reporting OFF while the libcurl packages in the Dockerfiles go unused.
|
||||
if [[ ${WITH_CRASH_REPORTING:-} ]]; then
|
||||
args+=(--env "WITH_CRASH_REPORTING=${WITH_CRASH_REPORTING}")
|
||||
fi
|
||||
# shellcheck disable=2086
|
||||
docker run "${args[@]}" $RUN_ARGS "$IMAGE_NAME" bash "$BUILD_SCRIPT" $RUN_OPTS "$@"
|
||||
return $?
|
||||
|
|
|
|||
|
|
@ -283,6 +283,18 @@ int main(int argc, char *argv[])
|
|||
// Silent opt-in: cached crash envelopes flush automatically once consent is given.
|
||||
crashReporter.giveConsent();
|
||||
}
|
||||
// Mid-session mode changes must reach the SDK: without this, switching from AlwaysSend to
|
||||
// NeverSend (or Ask) leaves consent given until restart, so a later crash in this session
|
||||
// would still upload after the user opted out. crashReporter outlives main(), so capturing
|
||||
// it here is safe.
|
||||
QObject::connect(&SettingsCache::instance().personal(), &PersonalSettings::crashReportingModeChanged,
|
||||
[&crashReporter](PersonalSettings::CrashReportingMode mode) {
|
||||
if (mode == PersonalSettings::CrashReportingMode::AlwaysSend) {
|
||||
crashReporter.giveConsent();
|
||||
} else {
|
||||
crashReporter.revokeConsent();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Persistent session log: keeps this run's logs on disk so the next-startup crash dialog can
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue