I am trying to open a tab in the salesforce console when the user clicks on a link but for some reason the link opens a new tab as well as overwriting the current tab with the new page. I am having a hard time finding the source of the error.
The VF page has a component (component A), which displays the info in the console. Inside component A, there's another component (component B) in which it initializes cometD stuff for platform events etc. in component B, there's a link that if the user clicks, it should open up a new tab display the relevant info. This works however it also overwrites all tabs on the console. The weird thing is that, in component A, there are other links that opens up new tabs, and they open up perfectly. It's just than in component B, it doesn't do it properly.
I call the following on my onClick function in component B:
sforce.console.openPrimaryTab(undefined, "/apex/SingleClientViewWrapper?id=a2j0Q0000004Lap", true, 'random');
I'm not sure how tabs works in salesforce in terms of primary tab, tab ID etc since this is all new to me.