Skip to content

Commit

Permalink
packagekit: Quiesce common tracer browser errors
Browse files Browse the repository at this point in the history
ModuleNotFoundError happens every time on every non-Fedora OS, and
there are common problem codes which don't need to make noise.
  • Loading branch information
martinpitt committed Oct 19, 2023
1 parent 4e00e50 commit f64e3d6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 9 additions & 1 deletion pkg/packagekit/updates.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 0 additions & 2 deletions test/common/testlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit f64e3d6

Please sign in to comment.