From f64e3d6a8556a280de49e65d2ffa57e9ba1b7c9d Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Wed, 18 Oct 2023 10:18:52 +0200 Subject: [PATCH] packagekit: Quiesce common tracer browser errors ModuleNotFoundError happens every time on every non-Fedora OS, and there are common problem codes which don't need to make noise. --- pkg/packagekit/updates.jsx | 10 +++++++++- test/common/testlib.py | 2 -- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/pkg/packagekit/updates.jsx b/pkg/packagekit/updates.jsx index 758f3966fa22..0445405ed654 100644 --- a/pkg/packagekit/updates.jsx +++ b/pkg/packagekit/updates.jsx @@ -1075,7 +1075,15 @@ class OsUpdates extends React.Component { this.setState(nextState); }) .catch((exception, data) => { - console.error(`Tracer failed: "${JSON.stringify(exception)}", data: "${JSON.stringify(data)}"`); + // common cases: this platform does not have tracer installed + if (!exception.message?.includes("ModuleNotFoundError") && + // or supported (like on Arch) + !exception.message?.includes("UnsupportedDistribution") && + // or polkit does not allow it + exception.problem !== "access-denied" && + // or the session goes away while checking + exception.problem !== "terminated") + console.error(`Tracer failed: "${JSON.stringify(exception)}", data: "${JSON.stringify(data)}"`); // When tracer fails, act like it's not available (demand reboot after every update) const nextState = { tracerAvailable: false, tracerRunning: false, tracerPackages: { reboot: [], daemons: [], manual: [] } }; if (state) diff --git a/test/common/testlib.py b/test/common/testlib.py index 648a8436490b..077f8d5ad79e 100644 --- a/test/common/testlib.py +++ b/test/common/testlib.py @@ -1707,8 +1707,6 @@ def login_and_go(self, path: Optional[str] = None, user: Optional[str] = None, h "Warning: Failed.*type.*prop Invalid prop", "Warning: React does not recognize the.*prop on a DOM element", "Warning: .*prop on .* should not be null", - # HACK: this should be fixed, it's completely expected on OSes without tracer - "Tracer failed:.*", # HACK: These should be fixed, but debugging these is not trivial, and the impact is very low "Warning: .* setState.*on an unmounted component", "Warning: Can't perform a React state update on an unmounted component",