fix: install_failure type mismatch — issue never reached GitHub
SetupActivity was sending type 'install-failure' (hyphen) but the PHP version-guard bypass list only checked for 'install_failure' (underscore). Result: if the kiosk was not on the latest released version the error was silently discarded and no GitHub issue was created. Fix: - SetupActivity: change type to 'install_failure' (underscore, consistent with KioskActivity which already used the correct name) - api/index.php: add 'install-failure' (hyphen) to the bypass list as defensive fallback so old APK builds already in the field are covered too
This commit is contained in:
+1
-1
@@ -5691,7 +5691,7 @@ function reportError(): void {
|
|||||||
// Exception: install/update errors are ALWAYS reported regardless of version,
|
// Exception: install/update errors are ALWAYS reported regardless of version,
|
||||||
// because a device that is failing to install the update is by definition on
|
// because a device that is failing to install the update is by definition on
|
||||||
// an old version — suppressing the issue is the opposite of useful.
|
// an old version — suppressing the issue is the opposite of useful.
|
||||||
$installErrorTypes = ['install_download_failed', 'install_failure', 'install_packager_exception'];
|
$installErrorTypes = ['install_download_failed', 'install_failure', 'install-failure', 'install_packager_exception'];
|
||||||
$bypassVersionGuard = in_array($type, $installErrorTypes, true)
|
$bypassVersionGuard = in_array($type, $installErrorTypes, true)
|
||||||
|| ($context['version_guard_bypass'] ?? false);
|
|| ($context['version_guard_bypass'] ?? false);
|
||||||
if (!$bypassVersionGuard && !_isLatestVersion($version)) {
|
if (!$bypassVersionGuard && !_isLatestVersion($version)) {
|
||||||
|
|||||||
@@ -868,7 +868,7 @@ class SetupActivity : AppCompatActivity() {
|
|||||||
val msg = intent?.getStringExtra(android.content.pm.PackageInstaller.EXTRA_STATUS_MESSAGE) ?: "status=$status"
|
val msg = intent?.getStringExtra(android.content.pm.PackageInstaller.EXTRA_STATUS_MESSAGE) ?: "status=$status"
|
||||||
setGatewayUI("❌", getString(R.string.install_error_install), msg, 0xFFf87171.toInt())
|
setGatewayUI("❌", getString(R.string.install_error_install), msg, 0xFFf87171.toInt())
|
||||||
ErrorReporter.reportMessage(
|
ErrorReporter.reportMessage(
|
||||||
"install-failure",
|
"install_failure",
|
||||||
"PackageInstaller failed: status=$status msg=$msg",
|
"PackageInstaller failed: status=$status msg=$msg",
|
||||||
mapOf("pkg" to targetPkg, "status" to status, "msg" to msg)
|
mapOf("pkg" to targetPkg, "status" to status, "msg" to msg)
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user