@opengeni/react 0.8.0 → 0.9.0
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.
package/dist/index.d.ts
CHANGED
|
@@ -505,6 +505,8 @@ type UseSessionEventsResult = {
|
|
|
505
505
|
connectionState: SessionEventsConnectionState;
|
|
506
506
|
/** Highest sequence seen so far (0 before the first event). */
|
|
507
507
|
lastSequence: number;
|
|
508
|
+
/** True until the initial tail window has been applied (windowed mode). */
|
|
509
|
+
initialLoading: boolean;
|
|
508
510
|
/** Whether older durable events are available before the current window. */
|
|
509
511
|
hasOlder: boolean;
|
|
510
512
|
/** True while an older window is being fetched. */
|
|
@@ -939,8 +941,9 @@ type UseSessionCapabilitiesOptions = ClientOverride & {
|
|
|
939
941
|
warmingPollMs?: number | undefined;
|
|
940
942
|
/**
|
|
941
943
|
* Give up waiting for `warm` after this long while polling (ms) and surface a
|
|
942
|
-
* stalled error with a manual `renegotiate`. Default 30000
|
|
943
|
-
*
|
|
944
|
+
* stalled error with a manual `renegotiate`. Default 30000. This is a UI
|
|
945
|
+
* patience deadline, independent from the worker's sandbox warming timeout.
|
|
946
|
+
* 0 disables the deadline.
|
|
944
947
|
*/
|
|
945
948
|
warmingDeadlineMs?: number | undefined;
|
|
946
949
|
};
|
package/dist/index.js
CHANGED
|
@@ -2756,8 +2756,7 @@ function formatDurationFacet(durationMs) {
|
|
|
2756
2756
|
|
|
2757
2757
|
// src/hooks/use-session-events.ts
|
|
2758
2758
|
var TAIL_PAGE_SIZE = 5e3;
|
|
2759
|
-
var
|
|
2760
|
-
var INITIAL_FETCH_CAP = 3;
|
|
2759
|
+
var INITIAL_FETCH_CAP = 1;
|
|
2761
2760
|
var OLDER_GROUP_TARGET = 32;
|
|
2762
2761
|
var OLDER_FETCH_CAP = 2;
|
|
2763
2762
|
var BOUNDARY_PAGE_CAP = 4;
|
|
@@ -2771,6 +2770,7 @@ function useSessionEvents(sessionId, options = {}) {
|
|
|
2771
2770
|
const [connectionState, setConnectionState] = useState8("idle");
|
|
2772
2771
|
const [error, setError] = useState8(null);
|
|
2773
2772
|
const [hasOlder, setHasOlder] = useState8(false);
|
|
2773
|
+
const [initialLoading, setInitialLoading] = useState8(true);
|
|
2774
2774
|
const [loadingOlder, setLoadingOlder] = useState8(false);
|
|
2775
2775
|
const lastSequenceRef = useRef2(after);
|
|
2776
2776
|
const oldestSequenceRef = useRef2(null);
|
|
@@ -2787,6 +2787,7 @@ function useSessionEvents(sessionId, options = {}) {
|
|
|
2787
2787
|
setError(null);
|
|
2788
2788
|
setHasOlder(false);
|
|
2789
2789
|
setLoadingOlder(false);
|
|
2790
|
+
setInitialLoading(true);
|
|
2790
2791
|
lastSequenceRef.current = after;
|
|
2791
2792
|
oldestSequenceRef.current = null;
|
|
2792
2793
|
hasOlderRef.current = false;
|
|
@@ -2822,7 +2823,7 @@ function useSessionEvents(sessionId, options = {}) {
|
|
|
2822
2823
|
const window2 = await loadEventWindow(client, workspaceId, sessionId, {
|
|
2823
2824
|
before: Number.MAX_SAFE_INTEGER,
|
|
2824
2825
|
pageSize: TAIL_PAGE_SIZE,
|
|
2825
|
-
targetGroups:
|
|
2826
|
+
targetGroups: Number.POSITIVE_INFINITY,
|
|
2826
2827
|
maxFetches: INITIAL_FETCH_CAP,
|
|
2827
2828
|
signal: controller.signal
|
|
2828
2829
|
});
|
|
@@ -2834,6 +2835,10 @@ function useSessionEvents(sessionId, options = {}) {
|
|
|
2834
2835
|
lastSequenceRef.current = window2.newestSequence;
|
|
2835
2836
|
setHasOlder(window2.hasOlder);
|
|
2836
2837
|
setEvents(window2.events);
|
|
2838
|
+
setInitialLoading(false);
|
|
2839
|
+
}
|
|
2840
|
+
if (fullReplay) {
|
|
2841
|
+
setInitialLoading(false);
|
|
2837
2842
|
}
|
|
2838
2843
|
const stream = client.streamEvents(workspaceId, sessionId, {
|
|
2839
2844
|
after: lastSequenceRef.current,
|
|
@@ -2919,6 +2924,7 @@ function useSessionEvents(sessionId, options = {}) {
|
|
|
2919
2924
|
sessionStatus,
|
|
2920
2925
|
connectionState,
|
|
2921
2926
|
lastSequence: lastSequenceRef.current,
|
|
2927
|
+
initialLoading: fullReplay ? false : initialLoading,
|
|
2922
2928
|
hasOlder: fullReplay ? false : hasOlder,
|
|
2923
2929
|
loadingOlder: fullReplay ? false : loadingOlder,
|
|
2924
2930
|
loadOlder,
|