Subpages become unreachable upon changing active Project

Hi, accidentally, while moving from one project to another in the same session, I’ve noticed that not all of my subPages are getting restored when moving back to the previous project AND at the same time I have changed one of my subPages to the currently active project.

Here are some screenshots to better describe the issue.

When we load an empty project and the script starts, we get this:


As we can see, the device is activated, and two subPages are activated as well, belonging to two subPages Areas. No problem so far.

Let’s now create a new project. The logger shows:


Again, nothing wrong here (even though we can notice doubling but it’s not to worry I guess).
We can see the previous project properly getting deactivated with the connected subPages, and then the other one getting activated and so are the subPages as they should.

Now, let’s go back to our previous project, only this time let’s move to the second subPage of the second subPages area and log:

Again, no problem at all. But now, let’s move to our other project for the final time:


As we can see, upon reactivating the other project, the second subPage is no longer getting activated! Furthermore, if one tries to workaround this (I did try) and trigger it manually with specific methods, again, it doesn’t get triggered. Seems like got recycled. But did it?
If we now reactivate the other project, we get:


To my surprise the subPage we previously have no contact with, now gets deactivated (as it should) upon the project’s deactivation! But then again, it’s not getting activated to our next project.

I’m trying to see this issue as something I overlooked while dealing with subPages, but it may be a bug. Here’s the code to reproduce the issue:

var midiremote_api=require('midiremote_api_v1')

var deviceDriver = midiremote_api.makeDeviceDriver('Issues', 'SubPagesActivation', 'Issue')

var midiInput = deviceDriver.mPorts.makeMidiInput()
var midiOutput = deviceDriver.mPorts.makeMidiOutput()

deviceDriver.makeDetectionUnit().detectPortPair(midiInput, midiOutput)
    .expectInputNameContains('loopMIDI 1')
    .expectOutputNameContains('loopMIDI 2')

var surface=deviceDriver.mSurface

var buttons=createButtons(4)

function createButtons(numOfButtons){

    var buttons=[]

    for(var i=0;i<numOfButtons;i++){

        var button=surface.makeButton(i,0,1,1)



    return buttons 


var page=deviceDriver.mMapping.makePage("aPage")

var subPagesAreas=[page.makeSubPageArea("subPageArea0"),page.makeSubPageArea("subPageArea1")]

var subPages=[subPagesAreas[0].makeSubPage("subPageArea00"),subPagesAreas[0].makeSubPage("subPageArea01"),subPagesAreas[1].makeSubPage("subPageArea10"),subPagesAreas[1].makeSubPage("subPageArea11")]

var transportValues=page.mHostAccess.mTransport.mValue

var bindings=[transportValues.mStart,transportValues.mStop,transportValues.mRewind,transportValues.mForward]

var i=0

    var realIndex=Math.floor(i/2)


        console.log("activating subPageArea "+Math.floor(this.i/2).toString()+" subPage "+(this.i % 2).toString())



        console.log("DEactivating subPageArea "+Math.floor(this.i/2).toString()+" subPage "+(this.i % 2).toString())






    console.log("project/device activated")

    console.log("project/device DEactivated")
1 Like