XKit-Rewritten icon indicating copy to clipboard operation
XKit-Rewritten copied to clipboard

Mutations util: Feature errors can break other features

Open marcustyphoon opened this issue 1 year ago • 1 comments

Platform

MacOS 14.4.1 arm64

Browser

Chrome 125.0.6422.77

Addon version

v0.23.6 (+ dev commits)

Details

https://github.com/AprilSylph/XKit-Rewritten/blob/a7bad978ff9978eecb8dc437dae7ef9af3a5571f/src/util/mutations.js#L77-L82

If a callback registered with pageModifications throws, and it is not an async function, onBeforeRepaint will throw and the entire set of callbacks remaining in the queue will not be executed. This means that a bug in a feature could become visible to the user as an entirely different feature not functioning, resulting in their bug report being very difficult to find the root cause of.

This, as they say in the business, Bad.

Only vaguely related: #1001 (in a vague sense the opposite of that PR in a number of ways, actually)

marcustyphoon avatar Jun 21 '24 02:06 marcustyphoon

This should probably be done for other parts of the extension too.

marcustyphoon avatar Jun 23 '24 17:06 marcustyphoon