RocketChat / RocketChat/Rocket.Chat
Improve error handling: check installApp return value before proceeding to initialization
@d-gubert is already working on this.
Since Nov 10, 2025.
- Dominant language
- TypeScript
- Stars
- 46.1k
- Forks
- 13.9k
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 130
Description
Context
The installApp method in packages/apps-engine/src/server/AppManager.ts returns a Promise<boolean> to signal success or failure. When an exception occurs during installation, it returns false and sets the app status to ERROR_DISABLED.
However, in the add() function (around line 636), this return value is currently ignored, allowing the app to proceed to initializeApp or runStartUpProcess regardless of whether installation succeeded.
Problem
This behavior is inconsistent with error handling elsewhere in the class and may mask critical installation failures. The return value should be captured and failures should be handled appropriately—either by preventing app initialization/enablement or by explicitly documenting why errors are non-blocking.
Related
- PR: https://github.com/RocketChat/Rocket.Chat/pull/37167
- Discussion: https://github.com/RocketChat/Rocket.Chat/pull/37167#discussion_r2511388279
- Requested by: @d-gubert
This issue was identified during code review but marked as out of scope for the original PR.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.