I figured it out now, see below.
At apptask.js:693, updateCommand calls omit() on the old manifest's addons field without guarding against it being absent. When the installed manifest has no addons
key, addons is undefined, causing Object.entries(undefined) to throw:
TypeError: Cannot convert undefined or null to object
at Object.entries (<anonymous>)
at Object.omit (file:///home/yellowtent/box/src/underscore.js:17:38)
at updateCommand (file:///home/yellowtent/box/src/apptask.js:693:28)
Because this is a plain TypeError rather than a BoxError, the catch block in run passes it to makeTaskError, which asserts error instanceof BoxError and crashes —
surfacing a secondary assertion error to the user instead of the real one.
To reproduce:
- Install an app whose CloudronManifest.json has no addons field
- Add "addons": {} to the manifest and push a new image
- Trigger an update from the dashboard
Expected: Update succeeds, or fails with a descriptive error about the manifest change.
Actual: Task crashes immediately with AssertionError: assert(error instanceof BoxError), hiding the real cause.
I re-installed the app, which solved the issue. I still believe the views should be consistent in error handling though.
