David - Hi, My thoughtspot dashboard is embedde...

Hi, My thoughtspot dashboard is embedded in my webapp using react. The problem is that it sends duplicate queries to snowflake.
9 Replies
shikharTS
shikharTS2mo ago
That should not be the case, is this happening when you open the dashboard in the ThoughtSpot app as well?
David
DavidOP2mo ago
No, only embedded. Gemini says I need to enclose in useEffect. Does that sound correct? // STEP 2: Wrap the initialization logic in a useEffect hook useEffect(() => { // We only want to run init() if we have a user, otherwise it might fail. // The component will re-render when user becomes available, but the // init() will have already run or been skipped. if (user && user.org_name) { console.log("Initializing ThoughtSpot SDK... (This should appear only once)"); init({ thoughtSpotHost: 'https://daisee-au.thoughtspot.cloud', authType: AuthType.TrustedAuthTokenCookieless, username: ${user.email}@${user.org_name}, }); } }, [user, getAccessTokenSilently]); // <--- STEP 3: Add a dependency array.
shikharTS
shikharTS2mo ago
This init happens before any data call to snowflake happens. This won't help..
David
DavidOP2mo ago
What are other possible causes?
shikharTS
shikharTS2mo ago
It usually happens when you are embedding the same liveboard multiple times. How are you seeing multiple duplicate queries in snowflake? are you rendering the liveboard again? Are you using any data calls?
David
DavidOP3w ago
@shikharTS Which code snipet and segment should I check?
shikharTS
shikharTS3w ago
I think it would be the liveboard embed. It might be difficult to debug this without artifacts (code, har files, the behaviour on TS app). We might need to get on a call with you, I would recommend to go through the support case to get this resolved.
David
DavidOP3w ago
I've already had a call with support and was referred here. I've attached the network log for the embedded and TS dashboards. Same Liveboard with 3 charts. 3 messages in TS but 6 embedded. I've also attached the embedding code. Can you see anything wrong?
No description
No description
No description
No description
No description
shikharTS
shikharTS3w ago
Does not look like anything is wrong..

Did you find this page helpful?