Skip to content

Problem with order of actions #1140

@lpatiny

Description

@lpatiny

When loading a module you have an event that generate an action when the module is loaded. The problem is that you want to be sure that the action already exists otherwise it will not be executed obviously.

In order to be 'sure' that the action exists I add it in the general preferences. However I get random results. Apparently in some case the action out from the module is executed before the general preferences action has been loaded and I don't understand why.

The relate loading order is I think here:

var view = Versioning.getView();
var data = Versioning.getData();
Promise.all([
loadCustomFilters(),
loadMainVariables(),
configureRequirejs(),
loadCustomModules()
])
.then(doInitScript)
.then(
function () {
ActionManager.viewHasChanged(view);
ModuleFactory.getModules().forEach(function (module) {
if (
module.controller &&
typeof module.controller.onGlobalPreferenceChange === 'function'
) {
module.controller.onGlobalPreferenceChange();
}
});
_modulesSet.then(checkCustomModules, checkCustomModules);
},

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions