[Embedded forms] variableManager.createVariable does not work when using promises

Hi, I wonder if anyone might be able to assist. I am trying to create variables within a promise chain during form submission but for some reason these variables are not being created. See example below:

var variableManager = camForm.variableManager;

inject(['$http', 'Uri', '$q', function ($http, Uri, $q) {

    function createVariableInPromise() {
        var deferred = $q.defer();
        var promise = deferred.promise;

        variableManager.createVariable({
            name: 'i_dont_get_created',
            type: 'String',
            value: 'no'
        });

        deferred.resolve(true);
        return promise;
    }

    async function perform() {
        var result = await createVariableInPromise();
    }


    camForm.on('submit', function(event) {

        variableManager.createVariable({
            name: 'i_get_created',
            type: 'String',
            value: 'yes'
        });

        perform();


        variableManager.createVariable({
            name: 'i_also_get_created',
            type: 'String',
            value: 'yes'
        });
    });

I found the problem, the problem lies within the submit callback. The callback is in fact just a callback and not a promise. The callback completes, submitting the form before the promise is done adding any variables to the form. Hence they are not displayed within camunda. It would be great to have an option to return a promise for the submit callback to allow the use of any asynchronous calls during the submit.