You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there a error event that fired when dashboard URL is expired? We are trying to catch the ERROR_OCCURRED when the dashboard URL is expired with 401
I am using v2 of the SDK which fires an onMessage event, but nothing is fired when the dashboard URL is expired with 401. Here is some sample code taken from the example in the docs but no changeEvent is logged in contentOptions.
import { useEffect, useState } from "react";
import { useLocation, useNavigate } from "react-router-dom";
const QuickSightEmbedding = require("amazon-quicksight-embedding-sdk");
const QuickSightReport = () => {
useEffect(() => {
const initLoad = async () => {
const embeddingContext = await QuickSightEmbedding.createEmbeddingContext();
const { embedDashboard } = embeddingContext;
var containerDiv = document.getElementById("embeddingContainer");
console.log('xxxx', containerDiv)
if (containerDiv) {
containerDiv.innerHTML = "";
}
const frameOptions = {
url: "<YOUR DASHBOARD URL>",
container: containerDiv,
height: "700px",
width: "300px",
onChange: (changeEvent: any, metadata: any) => {
if (changeEvent.eventLevel === "ERROR") {
console.log(
`Do something when embedding experience failed with "${changeEvent.eventName}"`
);
return;
}
switch (changeEvent.eventName) {
case "FRAME_MOUNTED": {
console.log("Do something when the experience frame is mounted.");
break;
}
case "FRAME_LOADED": {
console.log("Do something when the experience frame is loaded.");
break;
}
}
},
};
const contentOptions = {
onMessage: async (messageEvent: any, experienceMetadata: any) => {
console.log('vxsdfsdf')
switch (messageEvent.eventName) {
case "CONTENT_LOADED": {
console.log(
"Do something when the embedded experience is fully loaded."
);
break;
}
case "ERROR_OCCURRED": {
console.log(
"Do something when the embedded experience fails loading."
);
break;
}
//...
}
},
};
// Embedding a dashboard experience
const embeddedDashboardExperience = await embedDashboard(
frameOptions,
contentOptions
);
};
initLoad();
}, []);
return (
<>
<div className="customer-page reportBox">
<div id="embeddingContainer"></div>
</div>
</>
);
};
export default QuickSightReport;
The text was updated successfully, but these errors were encountered:
zhangjianrencai
changed the title
ERROR_OCCURRED is not trigger when dashboard url is expired
contentOptions.ERROR_OCCURRED is not trigger when dashboard url is expired
Aug 16, 2023
I am facing the same issue, how are you handling the situation of the session expires?
For example, I have a dashboard and my SessionLifetimeInMinutes is 15 minutes, after that 15 minutes any action that I perform in the dashboard doesn't work, and it stays loading forever, unless I refresh the page to generate the URL and the 15 minutes session again.
I can extend the session lifetime, but the problem is still there after it reaches the max session lifetime and the user will see the frozen screen and will have to refresh the page, which is not a good user experience. What I want is to automatically reload the dashboard when it expires, but without the event being fired I don't see many options. How are you handling that behavior other than just extend the lifetime, while that enhancement is not in place?
Is there a error event that fired when dashboard URL is expired? We are trying to catch the ERROR_OCCURRED when the dashboard URL is expired with 401
I am using v2 of the SDK which fires an onMessage event, but nothing is fired when the dashboard URL is expired with 401. Here is some sample code taken from the example in the docs but no changeEvent is logged in contentOptions.
The text was updated successfully, but these errors were encountered: