In chromium-render project we need to use the cancellable promises. This can be easily achieved by calling:
BBPromise.config({
cancellable: true
});The problem is that this code has to be executed before any promise is created, otherwise it fails with an error cannot enable cancellation after promises are in use Service-runner uses promises for everything, even reading a config files. Projects have the server.js file, which is not executed by service-runner (only thing it does it's calling the service-runner), so we cannot put that statement there. App.js is already too late as promises were created.
Proposed solution:
- an env variable: APP_ENABLE_CANCELLABLE_PROMISES, when is set, service-runner will call BBPromise.config() with proper parameter set as a first thing it does (before creating any promise)
- ??