basesite-shared-grid-lib 21.0.2 → 21.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
Binary file
|
|
@@ -2759,14 +2759,8 @@ class GridLibraryComponent {
|
|
|
2759
2759
|
if (this.enableServerSidePaging == true) {
|
|
2760
2760
|
// Show loading overlay immediately when server-side paging is enabled
|
|
2761
2761
|
this.gridAPI.showLoadingOverlay();
|
|
2762
|
-
//call api
|
|
2763
|
-
let reqHeaders = {
|
|
2764
|
-
'Content-type': 'application/json',
|
|
2765
|
-
Accept: 'application/json',
|
|
2766
|
-
Authorization: 'Bearer ' + this.token,
|
|
2767
|
-
};
|
|
2768
2762
|
// Add timeout to prevent infinite loading
|
|
2769
|
-
const API_TIMEOUT =
|
|
2763
|
+
const API_TIMEOUT = 80000; //80 seconds
|
|
2770
2764
|
let hasRetried = false;
|
|
2771
2765
|
this.odataProvider = new OdataServerSideProvider({
|
|
2772
2766
|
isCaseSensitiveStringFilter: false,
|
|
@@ -2777,6 +2771,15 @@ class GridLibraryComponent {
|
|
|
2777
2771
|
const timeoutPromise = new Promise((_, reject) => {
|
|
2778
2772
|
setTimeout(() => reject(new Error('API request timeout')), API_TIMEOUT);
|
|
2779
2773
|
});
|
|
2774
|
+
// Build headers on every call so we always use the latest token.
|
|
2775
|
+
// Capturing the token once (e.g. at grid-ready) meant that after the
|
|
2776
|
+
// token expired, every subsequent filter/sort/paging request kept
|
|
2777
|
+
// sending the stale token and silently failed with a 401.
|
|
2778
|
+
const reqHeaders = {
|
|
2779
|
+
'Content-type': 'application/json',
|
|
2780
|
+
Accept: 'application/json',
|
|
2781
|
+
Authorization: 'Bearer ' + this.token,
|
|
2782
|
+
};
|
|
2780
2783
|
const fetchPromise = fetch(url, {
|
|
2781
2784
|
headers: reqHeaders,
|
|
2782
2785
|
})
|