Hello, I've embedded some GoodData dashboards into...
# gooddata-ui
m
Hello, I've embedded some GoodData dashboards into our app via iframes. This works fine on Chrome. However, on Safari, it does not work. The console seems to indicate there is some permissions issue. Is there a way to fix this?
r
Hi Michael, Radek from the GD Technical team here! The "No session or session expired" response points to the fact that there is no active authentication session - usually, this is followed by re-authenticating, however if anything blocks the auth from being saved in the session cookies, you'd just be stuck in a loop. Are your cookie settings in Chrome and Safari different by any chance? 🙂
m
Hey Radek, it's the same exact setup. I'm wondering if it's related these third party cookie changes, which would affect all users of GD iframes: https://developer.mozilla.org/en-US/blog/goodbye-third-party-cookies/
r
Just to confirm, do you have both "Prevent cross-site tracking" and "Block all cookies" checkboxes unchecked in Safari? The alternatives to resolve cookie-related issues with embedding are listed here in the documentation.
m
I have safari's default settings. I should note this also doesn't work on the iphone, which also uses safari under the hood (even in the chrome browser).
I can try the react option. However, for solution 2, can you elaborate how this works:
We will provide a lightweight JavaScript library to make JWT-based authentication easier to use while maintaining the simplicity of iframe embedding. This method also supports authentication methods not natively supported by GoodData (e.g., SAML, LDAP, custom authentication).
r
That's the one 👍 React is always an option, however it might be a bit too much if all you're looking for is just showing a dashboard without anything extra.
m
I've switched to loading our dashboards via react. They're loading.. kind of. The structure of the dashboard is loading, but the data isn't. I'm using
ContextDeferredAuthProvider
with
redirectToTigerAuthentiaction
. Did I miss a step in setting up auth?
r
Well, if the dashboard structure loads, authentication is not the issue 🙂 I recall seeing this with another customer some time ago.. what GD.UI version are you on?
m
Copy code
grep gooddata package.json
    "@gooddata/api-client-tiger": "^10.3.0",
    "@gooddata/sdk-backend-tiger": "^10.3.0",
    "@gooddata/sdk-model": "^10.3.0",
    "@gooddata/sdk-ui-charts": "^10.3.0",
    "@gooddata/sdk-ui-dashboard": "^10.3.0",
    "@gooddata/sdk-ui-ext": "^10.3.0",
    "@gooddata/sdk-ui-geo": "^10.3.0",
    "@gooddata/sdk-ui-pivot": "^10.3.0",
Yeah, I figured auth was fixed... but not seeing any obvious error messages.
r
If you try to use any other GD.UI component (for example just the generic InsightView), does the same happen or does the component load fine?
m
Well, I'm getting this error. Maybe I'm missing some dep?
👀 1
Any insights here @Radek Novacek?
r
The fact that this is specifically mentioning the InsightViewCore could be hinting at missing dependencies, but not sure 100% - can you add a code snippet of your imports + implementation of the InsightView component so that I can try to replicate? 🙂
m
OK, in isolating the relevant code, I realized I wasn't passing the backend and workspace ID.
That fixes this issue. Going to see if using contexts for those fixes the original problem - I'm directly passing the workspace ID and backend to the dashboard element... maybe it's not making it down to the children?
Update: I'm able to get insights to display, but not dashboards - still have the dashboard's insights in a permanent loading state. I do see the following error in the dev console, but that's all:
This code is the problem (part of React-Admin), but if I swap the Dashboard component for an insight, it works:
Copy code
import { ShowBase } from "react-admin";
import { ErrorBoundary } from "react-error-boundary";
import { AxiosInstance } from "axios";
import tigerFactory, {
  ContextDeferredAuthProvider,
  redirectToTigerAuthentication,
} from "@gooddata/sdk-backend-tiger";
import { BackendProvider, WorkspaceProvider } from "@gooddata/sdk-ui";
import { Dashboard } from "@gooddata/sdk-ui-dashboard";
import "@gooddata/sdk-ui-dashboard/styles/css/main.css";
import "@gooddata/sdk-ui-filters/styles/css/main.css";
import "@gooddata/sdk-ui-charts/styles/css/main.css";
import "@gooddata/sdk-ui-geo/styles/css/main.css";
import "@gooddata/sdk-ui-pivot/styles/css/main.css";
import "@gooddata/sdk-ui-kit/styles/css/main.css";
import "@gooddata/sdk-ui-ext/styles/css/main.css";

const DashboardEmbed: React.FC = () => {
  // Setup GoodData.
  const gdAuthProvider = new ContextDeferredAuthProvider(
    redirectToTigerAuthentication
  );
  const backend = tigerFactory()
    .onHostname("<https://dashboards.goarrowsup.com>")
    .withAuthentication(gdAuthProvider);

  return (
    <BackendProvider backend={backend}>
      <WorkspaceProvider workspace={"arrows-up"}>
        <Dashboard dashboard={"af05374e-58ab-4603-ae93-62ad99351059"} />
      </WorkspaceProvider>
    </BackendProvider>
  );
};

export const GoodDataDashboardShow = (api: AxiosInstance) => {
  return (
    <ShowBase resource="gooddata-dashboard-config">
      <ErrorBoundary fallback={<div>Something went wrong</div>}>
        <DashboardEmbed />
      </ErrorBoundary>
    </ShowBase>
  );
};
r
Hey Michael, I'll try to reproduce and bring this up with the frontend devs if I do - it might take until tomorrow for me to give you any more updates, but please stay tuned 🙂
👍 1
m
Hey @Radek Novacek, any update on this?
Bump.
j
Hi Michael, before rendering dashboards it needs to be calculated. When you check network tab in browser dev tools there should be execute API calls and corresponding calls for fetching data. Something like
/api/v1/actions/workspaces/WS_ID/execution/afm/execute
and corresponding result fetch
api/v1/actions/workspaces/WS_ID/execution/afm/execute/result/EXEC_HASH?offset=0%2C0&limit=100%2C1000
do you see the calls?
m
Hey @Jan Kos, I see them. All 200s:
Although I just reloaded the page and don't see them:
r
Hi Michael, in the case when you can actually see the afm execute calls, does the dashboard load or is it still the same?
m
I've never seen the dashboard load.
Well, like I said earlier: the dashboard loads the "skeleton", but all of the insights are stuck loading - no data is ever shown.
r
Hmm, do you think you could share your whole package.json with me? DMs are okay too 🙂 This seems to be something entirely too specific clashing somewhere, I've seen the same issue exactly once before, and that solution didn't end up requiring a Dashboard, so I'd really like to get as much detail on this as possible.
m
Sure. One min.
Sent via DM.
🙏 1
@Radek Novacek, little update here: I might be having auth issues. I have lots of
Third-party cookie will be blocked in future Chrome versions as part of Privacy Sandbox.
in Chrome and I have nothing working in safari. This is when using the
InsightView
directly. I'm looking into this. Obviously need a solution that doesn't use third-party cookies since those are going away everywhere (otherwise I'd keep using iframes). I'll keep you updated if I find anything on my end.
I disabled third-party cookies, and nothing is working now. Is that expected from "Context deferred authentication"?
Hey @Radek Novacek, I ended up switching to JWTs for auth, but am having the same issue - I can't render an insight view and each insight in a dashboard is stuck loading. Also, I upgraded all the gooddata ui libraries to 10.4.
Verified the same problem in safari:
I don't see execute calls.
r
Hey @Michael DeWulf, apologies for the delay! So, I may have found the solution for this after playing with the reproducer for a while.. I believe the Dashboard component is just unhappy with React in Strict mode, and removing it should resolve this 🙂
m
That works! Thanks so much Radek!