function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Paulie PeñaPaulie Peña 

Bug In workspace.getAllTabInfo()

Some of our orgs recently got an update (they used to have a bear watering a bonsai tree, but now they have a snorkeling bear). Our Lightning Component's "init" aura:handler has a setTimeout(), which calls workspace.getAllTabInfo(), which is supposed to return a Promise (I need this to workaround this bug https://success.salesforce.com/issues_view?id=a1p3A0000001D3FQAU and I added a comment about the bug in this idea https://success.salesforce.com/ideaView?id=0873A000000E5HMQA0).

Unfortunately, after the update, whenever our Lightning Component's tab is refreshed (using the tab menu, next to the close button), workspace.getAllTabInfo() is returning undefined and therefore causes an exception when our code tries to call then() on what should be a Promise but is instead undefined.

The problem only happens on the second tab that gets loaded, not the first tab that's loaded in the Lightning Console app. We have multiple Lightning components that share the same "init" aura:handler, and if we have two of our Lightning tabs open, only refreshing the one that was loaded second causes the problem.

I traced the issue down to the if (1 !== this.I) in the below code in aura_prod.js, since the old code used to have a value of 0 when I called workspace.getAllTabInfo(), so would actually return a value, but now it has a value of 1 and does not return anything:
E.prototype.get = function(a) {
  if (1 !== this.I) {
    a = $A.P.normalize(a);
    var b = a.split(t)
    , c = b.shift()
    , d = this.Ic(c, this);
    return b.length ? (d || $A.assert(r, Cn + a + dd + c + Zc),
        $A.util.M(d.get) ? d.get(b.join(t), this) : $A.P.Mb(b, d)) : d
  }
}

BTW, how can I tell what version of Salesforce I'm running, since all of our orgs say Spring '18, but they are clearly different versions? It would be nice to be able to talk about the org version instead of having to say, "they used to have a bear watering a bonsai tree, but now they have a snorkeling bear."
Alain CabonAlain Cabon
Hi,

You can change the API version of a Lex component clicking on "Bundle Version Settings". 

User-added image

 
Paulie PeñaPaulie Peña
Thank you for that suggestion. I see that the older Spring '18 org only goes up to API Version 42.0, whereas the newer Spring '18 org goes up to API version 43.0. My controller is set to use API version 41.0 on both orgs, but I guess that doesn't affect which aura_prod.js script is used in the front-end. I guess each org only has one aura_prod.js script, so maybe the right thing to say is that the bug is in the aura_prod.js script for Salesforce API version 43.0.