tableau/embedding-api-v3-guide

Embedding API V3 applyFilterAsync throws service registry error

shengc5 opened this issue · 8 comments

Hi I'm using Embedding API V3 latest with Connected Apps to host embeds from Tableau Server on a Angular SPA. Whenever I try to call applyFilterAsync a strange internal-error: Service not registered: filter-service is thrown and filters do not get applied.

Screenshot 2023-06-21 at 12 27 15 PM


If I have the exact same setup but host a public Superstore example dashboard. No error is thrown.
Screenshot 2023-06-21 at 12 24 13 PM

Looking into the source code, I think the issue lies within how API Service Registry is set up during initialization. In screenshot 1, the global __tableauApiServiceRegistry object contains 2 ServiceRegistryImpl objects where the first one only includes notification-service and the second one contains filter-service. applyFilterAsync first checks if filter-service is registered in the service registry and hence throws an error

In screenshot 2, however, __tableauApiServiceRegistry contains exactly 1 ServiceRegistryImpl object and it has filter-service in it. Therefore it has no problem finding it and applying filters.

If in my case if I manually reassign the 1st index ServiceRegistryImpl to overwrite the 0th index one, no error is thrown and the filter works. But I feel like I shouldn't have to mess with the inner workings of the library and suspect it's either a bug or something about my Tableau Server configuration/Connected Apps setup that caused initialization to not happen properly. Can you provide some support/insights here? Thanks

Hello, is there any support on this? We worked with the Tableau Support team on it also but it's beyond their scope

Hi @shengc5 , thank you for raising this issue. Could you please provide some more details that will help us repro this issue consistently:

  • The version of the tableau server you are running.
  • A complete code snippet that shows the sequence of steps that lead to this error. I see that there are some snippets in the screenshot above, but complete snippet will help us get a complete picture.

Hello, our enterprise instance is on Tableau Server Version: 2022.1.9 (20221.22.1108.1355) 64-bit Windows and the client library is pointing to tableau.embedding.3.latest.js (is there a way to find our the specific minor version number by inspecting the file itself?)

There isn't much logic else other than the API call to get the Connected Apps jwt token. Rest of the code snippet should be almost identical to Tableau tutorials on how to apply interactive filters.

Ps: the dashboards I'm having issues with contain highly confidential data so I had to redact the server name/workbook URL. Let me know if there is a private, secure way to show debugging info directly with the team. Thanks

Hi @shengc5, I was unable to repro this on the tableau server version mentioned above. Could you join our dataDev slack channel (https://tabsoft.co/JoinTableauDev). We can gather some more repro steps there.

@shengc5, You could also share the code and clear out the src url as well as the Connected app secrets if that makes it easier.

Can you add my email shengch28@gmail.com to the channel? Unable to join it.

Also with regards to code, everything was there in the screenshot; one component and 4 lines of code taken from the official docs with minor modifications

Hey @shengc5 , looks like you are part of the channel now and have started similar thread there as well. Some thoughts:

  • Could you share your current network trace. Might be useful to see if there is some timing issue.
  • Could you confirm that you are making your calls inside the firstInteractive event. Not sure if that will fix your issue but it is worth trying that out if you haven't already.
  • Could you also confirm that the client library "tableau.embedding.3.latest.js" is loaded from the "022.1.9 (20221.22.1108.1355) 64-bit Windows" server mentioned above.

Closing due to age and reproducibility.