@buoy-gg/events 7.0.30 → 7.0.32
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/lib/commonjs/components/EventsCopySettingsView.js +15 -1
- package/lib/commonjs/components/EventsCopySettingsView.js.map +1 -1
- package/lib/commonjs/components/EventsModal.js +29 -7
- package/lib/commonjs/components/EventsModal.js.map +1 -1
- package/lib/commonjs/components/UnifiedEventDetail.js +23 -3
- package/lib/commonjs/components/UnifiedEventDetail.js.map +1 -1
- package/lib/commonjs/components/UnifiedEventFilters.js +15 -0
- package/lib/commonjs/components/UnifiedEventFilters.js.map +1 -1
- package/lib/commonjs/components/UnifiedEventItem.js +23 -6
- package/lib/commonjs/components/UnifiedEventItem.js.map +1 -1
- package/lib/commonjs/components/UnifiedEventList.js +13 -1
- package/lib/commonjs/components/UnifiedEventList.js.map +1 -1
- package/lib/commonjs/hooks/useUnifiedEvents.js +119 -160
- package/lib/commonjs/hooks/useUnifiedEvents.js.map +1 -1
- package/lib/commonjs/index.js +44 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/stores/unifiedEventStore.js +57 -3
- package/lib/commonjs/stores/unifiedEventStore.js.map +1 -1
- package/lib/commonjs/utils/autoDiscoverEventSources.js +54 -0
- package/lib/commonjs/utils/autoDiscoverEventSources.js.map +1 -1
- package/lib/commonjs/utils/badgeSelectionStorage.js +36 -0
- package/lib/commonjs/utils/badgeSelectionStorage.js.map +1 -1
- package/lib/commonjs/utils/eventVisibility.js +76 -0
- package/lib/commonjs/utils/eventVisibility.js.map +1 -0
- package/lib/commonjs/utils/testIDs.js +91 -0
- package/lib/commonjs/utils/testIDs.js.map +1 -0
- package/lib/module/components/EventsCopySettingsView.js +15 -1
- package/lib/module/components/EventsCopySettingsView.js.map +1 -1
- package/lib/module/components/EventsModal.js +32 -9
- package/lib/module/components/EventsModal.js.map +1 -1
- package/lib/module/components/UnifiedEventDetail.js +23 -3
- package/lib/module/components/UnifiedEventDetail.js.map +1 -1
- package/lib/module/components/UnifiedEventFilters.js +15 -0
- package/lib/module/components/UnifiedEventFilters.js.map +1 -1
- package/lib/module/components/UnifiedEventItem.js +23 -6
- package/lib/module/components/UnifiedEventItem.js.map +1 -1
- package/lib/module/components/UnifiedEventList.js +13 -1
- package/lib/module/components/UnifiedEventList.js.map +1 -1
- package/lib/module/hooks/useUnifiedEvents.js +122 -163
- package/lib/module/hooks/useUnifiedEvents.js.map +1 -1
- package/lib/module/index.js +11 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/stores/unifiedEventStore.js +54 -1
- package/lib/module/stores/unifiedEventStore.js.map +1 -1
- package/lib/module/utils/autoDiscoverEventSources.js +54 -0
- package/lib/module/utils/autoDiscoverEventSources.js.map +1 -1
- package/lib/module/utils/badgeSelectionStorage.js +34 -0
- package/lib/module/utils/badgeSelectionStorage.js.map +1 -1
- package/lib/module/utils/eventVisibility.js +70 -0
- package/lib/module/utils/eventVisibility.js.map +1 -0
- package/lib/module/utils/testIDs.js +83 -0
- package/lib/module/utils/testIDs.js.map +1 -0
- package/lib/typescript/components/EventsCopySettingsView.d.ts.map +1 -1
- package/lib/typescript/components/EventsModal.d.ts.map +1 -1
- package/lib/typescript/components/UnifiedEventDetail.d.ts.map +1 -1
- package/lib/typescript/components/UnifiedEventFilters.d.ts.map +1 -1
- package/lib/typescript/components/UnifiedEventItem.d.ts.map +1 -1
- package/lib/typescript/components/UnifiedEventList.d.ts.map +1 -1
- package/lib/typescript/hooks/useUnifiedEvents.d.ts +10 -1
- package/lib/typescript/hooks/useUnifiedEvents.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +2 -0
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/stores/unifiedEventStore.d.ts +13 -0
- package/lib/typescript/stores/unifiedEventStore.d.ts.map +1 -1
- package/lib/typescript/utils/autoDiscoverEventSources.d.ts.map +1 -1
- package/lib/typescript/utils/badgeSelectionStorage.d.ts +9 -0
- package/lib/typescript/utils/badgeSelectionStorage.d.ts.map +1 -1
- package/lib/typescript/utils/eventVisibility.d.ts +34 -0
- package/lib/typescript/utils/eventVisibility.d.ts.map +1 -0
- package/lib/typescript/utils/testIDs.d.ts +45 -0
- package/lib/typescript/utils/testIDs.d.ts.map +1 -0
- package/package.json +3 -3
|
@@ -9,6 +9,7 @@ var _sharedUi = require("@buoy-gg/shared-ui");
|
|
|
9
9
|
var _unifiedEventStore = require("../stores/unifiedEventStore");
|
|
10
10
|
var _badgeSelectionStorage = require("../utils/badgeSelectionStorage");
|
|
11
11
|
var _autoDiscoverEventSources = require("../utils/autoDiscoverEventSources");
|
|
12
|
+
var _eventVisibility = require("../utils/eventVisibility");
|
|
12
13
|
/**
|
|
13
14
|
* useUnifiedEvents Hook
|
|
14
15
|
*
|
|
@@ -16,49 +17,6 @@ var _autoDiscoverEventSources = require("../utils/autoDiscoverEventSources");
|
|
|
16
17
|
* Automatically discovers and subscribes to available event sources.
|
|
17
18
|
*/
|
|
18
19
|
|
|
19
|
-
/** Network hosts used internally by Buoy dev tools */
|
|
20
|
-
const BUOY_INTERNAL_HOSTS = ["api.keygen.sh"];
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Check if an event is generated by Buoy's own dev tools (internal housekeeping).
|
|
24
|
-
* These are filtered out by default so users only see their app's events.
|
|
25
|
-
*/
|
|
26
|
-
function isBuoyInternalEvent(event) {
|
|
27
|
-
const original = event.originalEvent;
|
|
28
|
-
if (!original) return false;
|
|
29
|
-
|
|
30
|
-
// Storage events: check if the key belongs to dev tools (@react_buoy prefix)
|
|
31
|
-
if (event.source === "storage-async" || event.source === "storage-mmkv") {
|
|
32
|
-
const key = original.data?.key || original.key;
|
|
33
|
-
if (key && (0, _sharedUi.isDevToolsStorageKey)(key)) return true;
|
|
34
|
-
|
|
35
|
-
// Multi-key operations: check if ALL keys are dev tool keys
|
|
36
|
-
const keys = original.data?.keys || original.data?.pairs?.map(p => p[0]);
|
|
37
|
-
if (keys && keys.length > 0 && keys.every(k => (0, _sharedUi.isDevToolsStorageKey)(k))) return true;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
// Network events: check if the host/URL matches Buoy's internal APIs
|
|
41
|
-
if (event.source === "network") {
|
|
42
|
-
const host = original.host || "";
|
|
43
|
-
const url = original.url || "";
|
|
44
|
-
for (const internalHost of BUOY_INTERNAL_HOSTS) {
|
|
45
|
-
if (host.includes(internalHost) || url.includes(internalHost)) return true;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
return false;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Check whether a network event should be hidden because its URL matches one of
|
|
53
|
-
* the user's shared ignored-domain/URL patterns (the same store the Network tool
|
|
54
|
-
* writes to). Non-network events are never affected.
|
|
55
|
-
*/
|
|
56
|
-
function isNetworkEventIgnored(event, ignoredPatterns) {
|
|
57
|
-
if (event.source !== "network" || ignoredPatterns.length === 0) return false;
|
|
58
|
-
const url = event.originalEvent?.url ?? "";
|
|
59
|
-
return (0, _sharedUi.isUrlIgnored)(url, ignoredPatterns);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
20
|
/**
|
|
63
21
|
* Match an event against the header search query. Searches the two fields the
|
|
64
22
|
* row actually renders (title/subtitle) plus a network event's full URL — the
|
|
@@ -100,7 +58,7 @@ const SOURCE_TO_EVENT_SOURCES = {
|
|
|
100
58
|
jotai: ["jotai"],
|
|
101
59
|
render: ["render"]
|
|
102
60
|
};
|
|
103
|
-
function useUnifiedEvents() {
|
|
61
|
+
function useUnifiedEvents(options) {
|
|
104
62
|
const {
|
|
105
63
|
isPro
|
|
106
64
|
} = (0, _sharedUi.useFeatureGate)();
|
|
@@ -117,6 +75,44 @@ function useUnifiedEvents() {
|
|
|
117
75
|
const [searchText, setSearchText] = (0, _react.useState)("");
|
|
118
76
|
const isStateRestoredRef = (0, _react.useRef)(false);
|
|
119
77
|
|
|
78
|
+
// Wall-clock windows during which capture was OFF. Releasing this hook's
|
|
79
|
+
// subscriptions is not enough to keep the list still: source subscriptions
|
|
80
|
+
// are ref-counted and a watching dashboard legitimately keeps capturing into
|
|
81
|
+
// the SHARED store while the device is paused. So events stamped inside a
|
|
82
|
+
// paused window stay hidden — and stay hidden AFTER resume too: the user was
|
|
83
|
+
// told the tool wasn't listening, and a resume that surfaces a backlog of
|
|
84
|
+
// "unheard" events reads as capture-while-off (pause → clear → tap around →
|
|
85
|
+
// resume must come back BLANK). The open window's start is persisted beside
|
|
86
|
+
// the capturing flag, so a remount or relaunch while paused keeps hiding
|
|
87
|
+
// from the ORIGINAL pause press, not from the reopen.
|
|
88
|
+
const effectiveCapturing = options?.capturingOverride ?? isCapturing;
|
|
89
|
+
const pausedAtRef = (0, _react.useRef)(null);
|
|
90
|
+
const pausedWindowsRef = (0, _react.useRef)([]);
|
|
91
|
+
// Bumped whenever a window opens or closes so the visibility memo re-runs.
|
|
92
|
+
const [pauseVersion, setPauseVersion] = (0, _react.useState)(0);
|
|
93
|
+
(0, _react.useEffect)(() => {
|
|
94
|
+
if (effectiveCapturing) {
|
|
95
|
+
if (pausedAtRef.current !== null) {
|
|
96
|
+
pausedWindowsRef.current = [...pausedWindowsRef.current, [pausedAtRef.current, Date.now()]];
|
|
97
|
+
pausedAtRef.current = null;
|
|
98
|
+
setPauseVersion(v => v + 1);
|
|
99
|
+
(0, _badgeSelectionStorage.savePausedAt)(null);
|
|
100
|
+
}
|
|
101
|
+
} else if (pausedAtRef.current === null) {
|
|
102
|
+
pausedAtRef.current = Date.now();
|
|
103
|
+
setPauseVersion(v => v + 1);
|
|
104
|
+
(0, _badgeSelectionStorage.savePausedAt)(pausedAtRef.current);
|
|
105
|
+
}
|
|
106
|
+
}, [effectiveCapturing]);
|
|
107
|
+
const isInPausedGap = (0, _react.useCallback)(timestamp => {
|
|
108
|
+
const pausedAt = pausedAtRef.current;
|
|
109
|
+
if (pausedAt !== null && timestamp > pausedAt) return true;
|
|
110
|
+
for (const [start, end] of pausedWindowsRef.current) {
|
|
111
|
+
if (timestamp > start && timestamp <= end) return true;
|
|
112
|
+
}
|
|
113
|
+
return false;
|
|
114
|
+
}, []);
|
|
115
|
+
|
|
120
116
|
// Get discovered sources (which packages are installed).
|
|
121
117
|
// Held in state, not a mount-only memo, because in remote mirror mode
|
|
122
118
|
// (desktop dashboard) the device's available sources arrive asynchronously
|
|
@@ -205,26 +201,42 @@ function useUnifiedEvents() {
|
|
|
205
201
|
// Load capturing state (default to true if not saved)
|
|
206
202
|
const savedCapturing = await (0, _badgeSelectionStorage.loadCapturingState)();
|
|
207
203
|
const shouldCapture = savedCapturing !== null ? savedCapturing : true;
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
if (sourcesToEnable.has("react-query-query") || sourcesToEnable.has("react-query-mutation")) {
|
|
216
|
-
(0, _unifiedEventStore.subscribeToReactQuery)();
|
|
217
|
-
}
|
|
218
|
-
if (sourcesToEnable.has("route")) (0, _unifiedEventStore.subscribeToRoutes)();
|
|
219
|
-
if (sourcesToEnable.has("zustand")) (0, _unifiedEventStore.subscribeToZustand)();
|
|
220
|
-
if (sourcesToEnable.has("jotai")) (0, _unifiedEventStore.subscribeToJotai)();
|
|
221
|
-
if (sourcesToEnable.has("render")) (0, _unifiedEventStore.subscribeToRender)();
|
|
204
|
+
if (!shouldCapture && pausedAtRef.current === null) {
|
|
205
|
+
// Seed the open paused window from the ORIGINAL pause press before the
|
|
206
|
+
// pause effect can stamp mount time over it — events captured (for a
|
|
207
|
+
// watching dashboard) between that press and this mount stay hidden.
|
|
208
|
+
const savedPausedAt = await (0, _badgeSelectionStorage.loadPausedAt)();
|
|
209
|
+
pausedAtRef.current = savedPausedAt ?? Date.now();
|
|
210
|
+
setPauseVersion(v => v + 1);
|
|
222
211
|
}
|
|
212
|
+
setIsCapturing(shouldCapture);
|
|
223
213
|
isStateRestoredRef.current = true;
|
|
214
|
+
// Drive the first sync DIRECTLY rather than trusting the effect below to
|
|
215
|
+
// fire. The setStates above sit behind TWO awaits, so React can commit
|
|
216
|
+
// the sources update while the restored-guard is still down (effect
|
|
217
|
+
// skips), and a same-value setIsCapturing then bails out without another
|
|
218
|
+
// commit — leaving the effect nothing to fire on and the tool deaf until
|
|
219
|
+
// something else changes state. The store's ledger diff makes this call
|
|
220
|
+
// idempotent with the effect's.
|
|
221
|
+
void (0, _unifiedEventStore.setLocalEnabledSources)(shouldCapture ? Array.from(sourcesToEnable) : []);
|
|
224
222
|
};
|
|
225
223
|
restoreState();
|
|
226
224
|
}, [availableDisplaySources]);
|
|
227
225
|
|
|
226
|
+
// Keep the store's local-consumer subscriptions in sync with what this hook
|
|
227
|
+
// wants: the enabled sources while capturing, nothing while paused. The store
|
|
228
|
+
// diffs each declaration against what it already holds for the on-device
|
|
229
|
+
// consumer, so remounts and re-runs are idempotent — imperative
|
|
230
|
+
// subscribe/unsubscribe pairs here used to drift (a reopened tool stacked a
|
|
231
|
+
// second ref per source, leaving capture running after the power toggle
|
|
232
|
+
// released only one).
|
|
233
|
+
(0, _react.useEffect)(() => {
|
|
234
|
+
if (!isStateRestoredRef.current) {
|
|
235
|
+
return;
|
|
236
|
+
}
|
|
237
|
+
void (0, _unifiedEventStore.setLocalEnabledSources)(isCapturing ? Array.from(enabledSources) : []);
|
|
238
|
+
}, [enabledSources, isCapturing]);
|
|
239
|
+
|
|
228
240
|
// Persist enabled sources whenever they change (after initial restoration)
|
|
229
241
|
(0, _react.useEffect)(() => {
|
|
230
242
|
if (!isStateRestoredRef.current) {
|
|
@@ -254,15 +266,32 @@ function useUnifiedEvents() {
|
|
|
254
266
|
}, [enabledSources]);
|
|
255
267
|
const normalizedSearch = searchText.trim().toLowerCase();
|
|
256
268
|
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
269
|
+
/**
|
|
270
|
+
* Everything this tool is willing to SHOW, before the user's own choices.
|
|
271
|
+
*
|
|
272
|
+
* Buoy's housekeeping writes and the shared ignored-URL patterns are removed
|
|
273
|
+
* here rather than alongside the source filter and the search, because the
|
|
274
|
+
* two kinds of hiding are not the same thing. A source badge and a search box
|
|
275
|
+
* are the user narrowing a list, and "Showing X of Y" is there to say so.
|
|
276
|
+
* This filter is the tool declining to report on itself, and there is no
|
|
277
|
+
* affordance anywhere that explains it — so counting these would make the
|
|
278
|
+
* header read "74 captured" over a list of 68, and leave the storage badge
|
|
279
|
+
* advertising writes that cannot be reached by any combination of controls.
|
|
280
|
+
*/
|
|
281
|
+
const visibleEvents = (0, _react.useMemo)(() => events.filter(event => !isInPausedGap(event.timestamp) && !(0, _eventVisibility.isBuoyInternalEvent)(event) && !(0, _eventVisibility.isNetworkEventIgnored)(event, ignoredPatterns)),
|
|
282
|
+
// pauseVersion invalidates this when a paused window opens or closes —
|
|
283
|
+
// the predicate itself reads refs.
|
|
284
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
285
|
+
[events, ignoredPatterns, isInPausedGap, pauseVersion]);
|
|
286
|
+
|
|
287
|
+
// What the user's own filters leave: the enabled sources and the header
|
|
288
|
+
// search, applied to the events above.
|
|
260
289
|
const allFilteredEvents = (0, _react.useMemo)(() => {
|
|
261
290
|
if (allowedEventSources.size === 0) {
|
|
262
291
|
return [];
|
|
263
292
|
}
|
|
264
|
-
return
|
|
265
|
-
}, [
|
|
293
|
+
return visibleEvents.filter(event => allowedEventSources.has(event.source) && (normalizedSearch === "" || matchesSearch(event, normalizedSearch)));
|
|
294
|
+
}, [visibleEvents, allowedEventSources, normalizedSearch]);
|
|
266
295
|
|
|
267
296
|
// Pro is Infinity here, so slice() returns everything and the hidden count
|
|
268
297
|
// floors at 0 — no tier branching needed at the call site.
|
|
@@ -271,7 +300,15 @@ function useUnifiedEvents() {
|
|
|
271
300
|
|
|
272
301
|
// Get all available sources with counts, sorted: enabled first, disabled last
|
|
273
302
|
const availableSources = (0, _react.useMemo)(() => {
|
|
274
|
-
|
|
303
|
+
// Counted from the visible set for the same reason `totalCount` is: a badge
|
|
304
|
+
// reading 72 over a list that can only ever show 69 of them is not a filter,
|
|
305
|
+
// it is a mystery. (`getSourceCounts()` is the raw store tally — still what
|
|
306
|
+
// the sync adapter reports to a dashboard, which wants the unfiltered
|
|
307
|
+
// truth.)
|
|
308
|
+
const counts = visibleEvents.reduce((acc, event) => {
|
|
309
|
+
acc[event.source] = (acc[event.source] ?? 0) + 1;
|
|
310
|
+
return acc;
|
|
311
|
+
}, {});
|
|
275
312
|
const subscriberCounts = (0, _unifiedEventStore.getSubscriberCounts)();
|
|
276
313
|
|
|
277
314
|
// Build a map from source ID to subscriber count
|
|
@@ -317,121 +354,43 @@ function useUnifiedEvents() {
|
|
|
317
354
|
if (!a.enabled && b.enabled) return 1;
|
|
318
355
|
return 0;
|
|
319
356
|
});
|
|
320
|
-
}, [
|
|
357
|
+
}, [visibleEvents, enabledSources, availableDisplaySources, subscriberCountVersion]);
|
|
358
|
+
|
|
359
|
+
// Pure state change — the sync effect above translates the new selection
|
|
360
|
+
// into store subscriptions, correctly keeping a shared discovery source
|
|
361
|
+
// (react-query serves both the query and mutation badges) alive while
|
|
362
|
+
// either badge still wants it.
|
|
321
363
|
const toggleSource = (0, _react.useCallback)(source => {
|
|
322
364
|
setEnabledSources(prev => {
|
|
323
365
|
const next = new Set(prev);
|
|
324
|
-
|
|
325
|
-
if (wasEnabled) {
|
|
366
|
+
if (next.has(source)) {
|
|
326
367
|
next.delete(source);
|
|
327
|
-
// Unsubscribe from the source
|
|
328
|
-
switch (source) {
|
|
329
|
-
case "storage-async":
|
|
330
|
-
(0, _unifiedEventStore.unsubscribeFromStorage)();
|
|
331
|
-
break;
|
|
332
|
-
case "redux":
|
|
333
|
-
(0, _unifiedEventStore.unsubscribeFromRedux)();
|
|
334
|
-
break;
|
|
335
|
-
case "network":
|
|
336
|
-
(0, _unifiedEventStore.unsubscribeFromNetwork)();
|
|
337
|
-
break;
|
|
338
|
-
case "react-query-query":
|
|
339
|
-
case "react-query-mutation":
|
|
340
|
-
(0, _unifiedEventStore.unsubscribeFromReactQuery)();
|
|
341
|
-
break;
|
|
342
|
-
case "route":
|
|
343
|
-
(0, _unifiedEventStore.unsubscribeFromRoutes)();
|
|
344
|
-
break;
|
|
345
|
-
case "zustand":
|
|
346
|
-
(0, _unifiedEventStore.unsubscribeFromZustand)();
|
|
347
|
-
break;
|
|
348
|
-
case "jotai":
|
|
349
|
-
(0, _unifiedEventStore.unsubscribeFromJotai)();
|
|
350
|
-
break;
|
|
351
|
-
case "render":
|
|
352
|
-
(0, _unifiedEventStore.unsubscribeFromRender)();
|
|
353
|
-
break;
|
|
354
|
-
}
|
|
355
368
|
} else {
|
|
356
369
|
next.add(source);
|
|
357
|
-
// Subscribe to the source (only if capturing is active)
|
|
358
|
-
if (isCapturing) {
|
|
359
|
-
switch (source) {
|
|
360
|
-
case "storage-async":
|
|
361
|
-
(0, _unifiedEventStore.subscribeToStorage)();
|
|
362
|
-
break;
|
|
363
|
-
case "redux":
|
|
364
|
-
(0, _unifiedEventStore.subscribeToRedux)();
|
|
365
|
-
break;
|
|
366
|
-
case "network":
|
|
367
|
-
(0, _unifiedEventStore.subscribeToNetwork)();
|
|
368
|
-
break;
|
|
369
|
-
case "react-query-query":
|
|
370
|
-
case "react-query-mutation":
|
|
371
|
-
(0, _unifiedEventStore.subscribeToReactQuery)();
|
|
372
|
-
break;
|
|
373
|
-
case "route":
|
|
374
|
-
(0, _unifiedEventStore.subscribeToRoutes)();
|
|
375
|
-
break;
|
|
376
|
-
case "zustand":
|
|
377
|
-
(0, _unifiedEventStore.subscribeToZustand)();
|
|
378
|
-
break;
|
|
379
|
-
case "jotai":
|
|
380
|
-
(0, _unifiedEventStore.subscribeToJotai)();
|
|
381
|
-
break;
|
|
382
|
-
case "render":
|
|
383
|
-
(0, _unifiedEventStore.subscribeToRender)();
|
|
384
|
-
break;
|
|
385
|
-
}
|
|
386
|
-
}
|
|
387
370
|
}
|
|
388
371
|
return next;
|
|
389
372
|
});
|
|
390
|
-
}, [
|
|
373
|
+
}, []);
|
|
391
374
|
const enableAllSources = (0, _react.useCallback)(() => {
|
|
392
375
|
setEnabledSources(new Set(availableDisplaySources));
|
|
393
376
|
}, [availableDisplaySources]);
|
|
394
377
|
const clearEvents = (0, _react.useCallback)(() => {
|
|
395
378
|
(0, _unifiedEventStore.clearEvents)();
|
|
396
379
|
}, []);
|
|
380
|
+
|
|
381
|
+
// Pure state changes — the sync effect declares the resulting desired set to
|
|
382
|
+
// the store, which releases every subscription this consumer holds when
|
|
383
|
+
// capture turns off (a dashboard's own subscriptions stay ref-counted and
|
|
384
|
+
// untouched).
|
|
397
385
|
const startCapturing = (0, _react.useCallback)(() => {
|
|
398
|
-
// Only subscribe to sources that are enabled
|
|
399
|
-
if (enabledSources.has("storage-async")) (0, _unifiedEventStore.subscribeToStorage)();
|
|
400
|
-
if (enabledSources.has("redux")) (0, _unifiedEventStore.subscribeToRedux)();
|
|
401
|
-
if (enabledSources.has("network")) (0, _unifiedEventStore.subscribeToNetwork)();
|
|
402
|
-
if (enabledSources.has("react-query-query") || enabledSources.has("react-query-mutation")) {
|
|
403
|
-
(0, _unifiedEventStore.subscribeToReactQuery)();
|
|
404
|
-
}
|
|
405
|
-
if (enabledSources.has("route")) (0, _unifiedEventStore.subscribeToRoutes)();
|
|
406
|
-
if (enabledSources.has("zustand")) (0, _unifiedEventStore.subscribeToZustand)();
|
|
407
|
-
if (enabledSources.has("jotai")) (0, _unifiedEventStore.subscribeToJotai)();
|
|
408
|
-
if (enabledSources.has("render")) (0, _unifiedEventStore.subscribeToRender)();
|
|
409
386
|
setIsCapturing(true);
|
|
410
|
-
}, [
|
|
387
|
+
}, []);
|
|
411
388
|
const stopCapturing = (0, _react.useCallback)(() => {
|
|
412
|
-
// Release only THIS hook's enabled sources (mirrors startCapturing). Source
|
|
413
|
-
// subscriptions are ref-counted in the store, so this won't yank sources a
|
|
414
|
-
// remote dashboard consumer is still watching (vs the old unsubscribeAll
|
|
415
|
-
// hard reset, which tore down everyone's).
|
|
416
|
-
if (enabledSources.has("storage-async")) (0, _unifiedEventStore.unsubscribeFromStorage)();
|
|
417
|
-
if (enabledSources.has("redux")) (0, _unifiedEventStore.unsubscribeFromRedux)();
|
|
418
|
-
if (enabledSources.has("network")) (0, _unifiedEventStore.unsubscribeFromNetwork)();
|
|
419
|
-
if (enabledSources.has("react-query-query") || enabledSources.has("react-query-mutation")) {
|
|
420
|
-
(0, _unifiedEventStore.unsubscribeFromReactQuery)();
|
|
421
|
-
}
|
|
422
|
-
if (enabledSources.has("route")) (0, _unifiedEventStore.unsubscribeFromRoutes)();
|
|
423
|
-
if (enabledSources.has("zustand")) (0, _unifiedEventStore.unsubscribeFromZustand)();
|
|
424
|
-
if (enabledSources.has("jotai")) (0, _unifiedEventStore.unsubscribeFromJotai)();
|
|
425
|
-
if (enabledSources.has("render")) (0, _unifiedEventStore.unsubscribeFromRender)();
|
|
426
389
|
setIsCapturing(false);
|
|
427
|
-
}, [
|
|
390
|
+
}, []);
|
|
428
391
|
const toggleCapturing = (0, _react.useCallback)(() => {
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
} else {
|
|
432
|
-
startCapturing();
|
|
433
|
-
}
|
|
434
|
-
}, [isCapturing, startCapturing, stopCapturing]);
|
|
392
|
+
setIsCapturing(prev => !prev);
|
|
393
|
+
}, []);
|
|
435
394
|
|
|
436
395
|
// Get subscriber counts (recalculates on every render, but it's a cheap operation)
|
|
437
396
|
const totalSubscriberCount = (0, _unifiedEventStore.getSubscriberCounts)().totalSubscribers;
|
|
@@ -445,7 +404,7 @@ function useUnifiedEvents() {
|
|
|
445
404
|
toggleSource,
|
|
446
405
|
enableAllSources,
|
|
447
406
|
clearEvents,
|
|
448
|
-
totalCount:
|
|
407
|
+
totalCount: visibleEvents.length,
|
|
449
408
|
filteredCount: filteredEvents.length,
|
|
450
409
|
isCapturing,
|
|
451
410
|
startCapturing,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_sharedUi","_unifiedEventStore","_badgeSelectionStorage","_autoDiscoverEventSources","BUOY_INTERNAL_HOSTS","isBuoyInternalEvent","event","original","originalEvent","source","key","data","isDevToolsStorageKey","keys","pairs","map","p","length","every","k","host","url","internalHost","includes","isNetworkEventIgnored","ignoredPatterns","isUrlIgnored","matchesSearch","query","title","toLowerCase","subtitle","ALL_DISPLAY_SOURCES","DEFAULT_ENABLED_SOURCES","filter","s","SOURCE_TO_EVENT_SOURCES","redux","network","route","zustand","jotai","render","useUnifiedEvents","isPro","useFeatureGate","eventLimit","useLimit","patterns","useIgnoredPatterns","events","setEvents","useState","enabledSources","setEnabledSources","Set","isCapturing","setIsCapturing","searchText","setSearchText","isStateRestoredRef","useRef","discoveredSources","setDiscoveredSources","getAvailableEventSources","subscriberCountVersion","setSubscriberCountVersion","useEffect","subscribeToSubscriberCountChanges","v","availableDisplaySources","useMemo","displaySource","eventSources","some","es","has","rafId","unsubscribe","subscribe","requestAnimationFrame","applyLatest","newEvents","getEvents","prev","next","size","cancelAnimationFrame","restoreState","savedSources","loadEnabledSources","sourcesToEnable","defaultEnabledAvailable","validSources","savedCapturing","loadCapturingState","shouldCapture","subscribeToStorage","subscribeToRedux","subscribeToNetwork","subscribeToReactQuery","subscribeToRoutes","subscribeToZustand","subscribeToJotai","subscribeToRender","current","saveEnabledSources","Array","from","saveCapturingState","allowedEventSources","allowed","forEach","add","normalizedSearch","trim","allFilteredEvents","filteredEvents","slice","hiddenEventsCount","Math","max","availableSources","counts","getSourceCounts","subscriberCounts","getSubscriberCounts","subscriberCountBySourceId","sources","sourceId","total","displaySourceToStoreId","totalCount","reduce","sum","displayConfig","getSourceDisplayConfig","storeId","subscriberCount","undefined","count","enabled","sort","a","b","toggleSource","useCallback","wasEnabled","delete","unsubscribeFromStorage","unsubscribeFromRedux","unsubscribeFromNetwork","unsubscribeFromReactQuery","unsubscribeFromRoutes","unsubscribeFromZustand","unsubscribeFromJotai","unsubscribeFromRender","enableAllSources","clearEvents","clearStoreEvents","startCapturing","stopCapturing","toggleCapturing","totalSubscriberCount","totalSubscribers","filteredCount"],"sourceRoot":"../../../src","sources":["hooks/useUnifiedEvents.ts"],"mappings":";;;;;;AAOA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAUA,IAAAE,kBAAA,GAAAF,OAAA;AAwBA,IAAAG,sBAAA,GAAAH,OAAA;AAMA,IAAAI,yBAAA,GAAAJ,OAAA;AAhDA;AACA;AACA;AACA;AACA;AACA;;AA6CA;AACA,MAAMK,mBAAmB,GAAG,CAAC,eAAe,CAAC;;AAE7C;AACA;AACA;AACA;AACA,SAASC,mBAAmBA,CAACC,KAAmB,EAAW;EACzD,MAAMC,QAAQ,GAAGD,KAAK,CAACE,aAAgD;EACvE,IAAI,CAACD,QAAQ,EAAE,OAAO,KAAK;;EAE3B;EACA,IAAID,KAAK,CAACG,MAAM,KAAK,eAAe,IAAIH,KAAK,CAACG,MAAM,KAAK,cAAc,EAAE;IACvE,MAAMC,GAAG,GAAGH,QAAQ,CAACI,IAAI,EAAED,GAAG,IAAIH,QAAQ,CAACG,GAAG;IAC9C,IAAIA,GAAG,IAAI,IAAAE,8BAAoB,EAACF,GAAG,CAAC,EAAE,OAAO,IAAI;;IAEjD;IACA,MAAMG,IAAI,GAAGN,QAAQ,CAACI,IAAI,EAAEE,IAAI,IAAIN,QAAQ,CAACI,IAAI,EAAEG,KAAK,EAAEC,GAAG,CAAEC,CAAoB,IAAKA,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7F,IAAIH,IAAI,IAAIA,IAAI,CAACI,MAAM,GAAG,CAAC,IAAIJ,IAAI,CAACK,KAAK,CAAEC,CAAS,IAAK,IAAAP,8BAAoB,EAACO,CAAC,CAAC,CAAC,EAAE,OAAO,IAAI;EAChG;;EAEA;EACA,IAAIb,KAAK,CAACG,MAAM,KAAK,SAAS,EAAE;IAC9B,MAAMW,IAAI,GAAGb,QAAQ,CAACa,IAAI,IAAI,EAAE;IAChC,MAAMC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nE,OAAO;IACLlH,MAAM;IACNmE,cAAc;IACdK,gBAAgB;IAChBrE,cAAc;IACdK,UAAU;IACVC,aAAa;IACbsF,YAAY;IACZY,gBAAgB;IAChBC,WAAW;IACX1B,UAAU,EAAElF,MAAM,CAACjC,MAAM;IACzBoJ,aAAa,EAAEhD,cAAc,CAACpG,MAAM;IACpCuC,WAAW;IACXwG,cAAc;IACdC,aAAa;IACbC,eAAe;IACfpG,iBAAiB;IACjByD,iBAAiB;IACjB3E,KAAK;IACLuH;EACF,CAAC;AACH","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_react","require","_sharedUi","_unifiedEventStore","_badgeSelectionStorage","_autoDiscoverEventSources","_eventVisibility","matchesSearch","event","query","title","toLowerCase","includes","subtitle","url","originalEvent","ALL_DISPLAY_SOURCES","DEFAULT_ENABLED_SOURCES","filter","s","SOURCE_TO_EVENT_SOURCES","redux","network","route","zustand","jotai","render","useUnifiedEvents","options","isPro","useFeatureGate","eventLimit","useLimit","patterns","ignoredPatterns","useIgnoredPatterns","events","setEvents","useState","enabledSources","setEnabledSources","Set","isCapturing","setIsCapturing","searchText","setSearchText","isStateRestoredRef","useRef","effectiveCapturing","capturingOverride","pausedAtRef","pausedWindowsRef","pauseVersion","setPauseVersion","useEffect","current","Date","now","v","savePausedAt","isInPausedGap","useCallback","timestamp","pausedAt","start","end","discoveredSources","setDiscoveredSources","getAvailableEventSources","subscriberCountVersion","setSubscriberCountVersion","subscribeToSubscriberCountChanges","availableDisplaySources","useMemo","displaySource","eventSources","some","es","has","rafId","unsubscribe","subscribe","requestAnimationFrame","applyLatest","newEvents","getEvents","prev","next","size","every","cancelAnimationFrame","restoreState","savedSources","loadEnabledSources","sourcesToEnable","defaultEnabledAvailable","length","validSources","savedCapturing","loadCapturingState","shouldCapture","savedPausedAt","loadPausedAt","setLocalEnabledSources","Array","from","saveEnabledSources","saveCapturingState","allowedEventSources","allowed","forEach","add","normalizedSearch","trim","visibleEvents","isBuoyInternalEvent","isNetworkEventIgnored","allFilteredEvents","source","filteredEvents","slice","hiddenEventsCount","Math","max","availableSources","counts","reduce","acc","subscriberCounts","getSubscriberCounts","subscriberCountBySourceId","sources","sourceId","total","displaySourceToStoreId","map","totalCount","sum","displayConfig","getSourceDisplayConfig","storeId","subscriberCount","undefined","count","enabled","sort","a","b","toggleSource","delete","enableAllSources","clearEvents","clearStoreEvents","startCapturing","stopCapturing","toggleCapturing","totalSubscriberCount","totalSubscribers","filteredCount"],"sourceRoot":"../../../src","sources":["hooks/useUnifiedEvents.ts"],"mappings":";;;;;;AAOA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAOA,IAAAE,kBAAA,GAAAF,OAAA;AAQA,IAAAG,sBAAA,GAAAH,OAAA;AAQA,IAAAI,yBAAA,GAAAJ,OAAA;AACA,IAAAK,gBAAA,GAAAL,OAAA;AAhCA;AACA;AACA;AACA;AACA;AACA;;AAgCA;AACA;AACA;AACA;AACA;AACA;AACA,SAASM,aAAaA,CAACC,KAAmB,EAAEC,KAAa,EAAW;EAClE,IAAID,KAAK,CAACE,KAAK,CAACC,WAAW,CAAC,CAAC,CAACC,QAAQ,CAACH,KAAK,CAAC,EAAE,OAAO,IAAI;EAC1D,IAAID,KAAK,CAACK,QAAQ,CAACF,WAAW,CAAC,CAAC,CAACC,QAAQ,CAACH,KAAK,CAAC,EAAE,OAAO,IAAI;EAC7D,MAAMK,GAAG,GAAIN,KAAK,CAACO,aAAa,EAAoCD,GAAG;EACvE,OAAO,OAAOA,GAAG,KAAK,QAAQ,IAAIA,GAAG,CAACH,WAAW,CAAC,CAAC,CAACC,QAAQ,CAACH,KAAK,CAAC;AACrE;;AAEA;AACA;AACA;AACA,MAAMO,mBAAkC,GAAG,CACzC,eAAe,EACf,OAAO,EACP,SAAS,EACT,mBAAmB,EACnB,sBAAsB,EACtB,OAAO,EACP,SAAS,EACT,OAAO,EACP,QAAQ,CACT;;AAED;AACA;AACA;AACA;AACA;AACA,MA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ACvClB,cAAc,CAAC,IAAI,CAAC;EACtB,CAAC,EAAE,EAAE,CAAC;EAEN,MAAM+G,aAAa,GAAG,IAAA7F,kBAAW,EAAC,MAAM;IACtClB,cAAc,CAAC,KAAK,CAAC;EACvB,CAAC,EAAE,EAAE,CAAC;EAEN,MAAMgH,eAAe,GAAG,IAAA9F,kBAAW,EAAC,MAAM;IACxClB,cAAc,CAAE2C,IAAI,IAAK,CAACA,IAAI,CAAC;EACjC,CAAC,EAAE,EAAE,CAAC;;EAEN;EACA,MAAMsE,oBAAoB,GAAG,IAAA3B,sCAAmB,EAAC,CAAC,CAAC4B,gBAAgB;EAEnE,OAAO;IACLzH,MAAM;IACNmF,cAAc;IACdK,gBAAgB;IAChBrF,cAAc;IACdK,UAAU;IACVC,aAAa;IACbuG,YAAY;IACZE,gBAAgB;IAChBC,WAAW;IACXf,UAAU,EAAEtB,aAAa,CAAClB,MAAM;IAChC8D,aAAa,EAAEvC,cAAc,CAACvB,MAAM;IACpCtD,WAAW;IACX+G,cAAc;IACdC,aAAa;IACbC,eAAe;IACfzF,iBAAiB;IACjBuD,iBAAiB;IACjB5F,KAAK;IACL+H;EACF,CAAC;AACH","ignoreList":[]}
|
package/lib/commonjs/index.js
CHANGED
|
@@ -15,6 +15,12 @@ Object.defineProperty(exports, "DEFAULT_COPY_SETTINGS", {
|
|
|
15
15
|
return _copySettings.DEFAULT_COPY_SETTINGS;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
|
+
Object.defineProperty(exports, "EVENTS_TEST_ID", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _testIDs.EVENTS_TEST_ID;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
18
24
|
Object.defineProperty(exports, "EventsCopySettingsView", {
|
|
19
25
|
enumerable: true,
|
|
20
26
|
get: function () {
|
|
@@ -105,6 +111,24 @@ Object.defineProperty(exports, "estimateExportSize", {
|
|
|
105
111
|
return _eventExportFormatter.estimateExportSize;
|
|
106
112
|
}
|
|
107
113
|
});
|
|
114
|
+
Object.defineProperty(exports, "eventFilterTestID", {
|
|
115
|
+
enumerable: true,
|
|
116
|
+
get: function () {
|
|
117
|
+
return _testIDs.eventFilterTestID;
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
Object.defineProperty(exports, "eventIdentity", {
|
|
121
|
+
enumerable: true,
|
|
122
|
+
get: function () {
|
|
123
|
+
return _testIDs.eventIdentity;
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
Object.defineProperty(exports, "eventRowTestID", {
|
|
127
|
+
enumerable: true,
|
|
128
|
+
get: function () {
|
|
129
|
+
return _testIDs.eventRowTestID;
|
|
130
|
+
}
|
|
131
|
+
});
|
|
108
132
|
Object.defineProperty(exports, "eventsSyncAdapter", {
|
|
109
133
|
enumerable: true,
|
|
110
134
|
get: function () {
|
|
@@ -195,6 +219,24 @@ Object.defineProperty(exports, "hasRelatedEvents", {
|
|
|
195
219
|
return _correlationUtils.hasRelatedEvents;
|
|
196
220
|
}
|
|
197
221
|
});
|
|
222
|
+
Object.defineProperty(exports, "isBuoyInternalEvent", {
|
|
223
|
+
enumerable: true,
|
|
224
|
+
get: function () {
|
|
225
|
+
return _eventVisibility.isBuoyInternalEvent;
|
|
226
|
+
}
|
|
227
|
+
});
|
|
228
|
+
Object.defineProperty(exports, "isEventHiddenFromTool", {
|
|
229
|
+
enumerable: true,
|
|
230
|
+
get: function () {
|
|
231
|
+
return _eventVisibility.isEventHiddenFromTool;
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
Object.defineProperty(exports, "isNetworkEventIgnored", {
|
|
235
|
+
enumerable: true,
|
|
236
|
+
get: function () {
|
|
237
|
+
return _eventVisibility.isNetworkEventIgnored;
|
|
238
|
+
}
|
|
239
|
+
});
|
|
198
240
|
Object.defineProperty(exports, "loadCopySettings", {
|
|
199
241
|
enumerable: true,
|
|
200
242
|
get: function () {
|
|
@@ -224,6 +266,7 @@ var _UnifiedEventViewer = require("./components/UnifiedEventViewer");
|
|
|
224
266
|
var _EventsModal = require("./components/EventsModal");
|
|
225
267
|
var _eventsSyncAdapter = require("./sync/eventsSyncAdapter");
|
|
226
268
|
var _useUnifiedEvents = require("./hooks/useUnifiedEvents");
|
|
269
|
+
var _eventVisibility = require("./utils/eventVisibility");
|
|
227
270
|
var _copySettings = require("./types/copySettings");
|
|
228
271
|
var _UnifiedEventItem = require("./components/UnifiedEventItem");
|
|
229
272
|
var _UnifiedEventList = require("./components/UnifiedEventList");
|
|
@@ -231,6 +274,7 @@ var _UnifiedEventFilters = require("./components/UnifiedEventFilters");
|
|
|
231
274
|
var _UnifiedEventDetail = require("./components/UnifiedEventDetail");
|
|
232
275
|
var _ReactQueryEventDetail = require("./components/ReactQueryEventDetail");
|
|
233
276
|
var _EventsCopySettingsView = require("./components/EventsCopySettingsView");
|
|
277
|
+
var _testIDs = require("./utils/testIDs");
|
|
234
278
|
var _correlationUtils = require("./utils/correlationUtils");
|
|
235
279
|
var _eventExportFormatter = require("./utils/eventExportFormatter");
|
|
236
280
|
var _copySettingsStorage = require("./utils/copySettingsStorage");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_preset","require","_UnifiedEventViewer","_EventsModal","_eventsSyncAdapter","_useUnifiedEvents","_copySettings","_UnifiedEventItem","_UnifiedEventList","_UnifiedEventFilters","_UnifiedEventDetail","_ReactQueryEventDetail","_EventsCopySettingsView","_correlationUtils","_eventExportFormatter","_copySettingsStorage","_unifiedEventStore"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_preset","require","_UnifiedEventViewer","_EventsModal","_eventsSyncAdapter","_useUnifiedEvents","_eventVisibility","_copySettings","_UnifiedEventItem","_UnifiedEventList","_UnifiedEventFilters","_UnifiedEventDetail","_ReactQueryEventDetail","_EventsCopySettingsView","_testIDs","_correlationUtils","_eventExportFormatter","_copySettingsStorage","_unifiedEventStore"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeA,IAAAA,OAAA,GAAAC,OAAA;AAKA,IAAAC,mBAAA,GAAAD,OAAA;AAGA,IAAAE,YAAA,GAAAF,OAAA;AAOA,IAAAG,kBAAA,GAAAH,OAAA;AAKA,IAAAI,iBAAA,GAAAJ,OAAA;AAQA,IAAAK,gBAAA,GAAAL,OAAA;AAuBA,IAAAM,aAAA,GAAAN,OAAA;AAUA,IAAAO,iBAAA,GAAAP,OAAA;AACA,IAAAQ,iBAAA,GAAAR,OAAA;AACA,IAAAS,oBAAA,GAAAT,OAAA;AACA,IAAAU,mBAAA,GAAAV,OAAA;AACA,IAAAW,sBAAA,GAAAX,OAAA;AACA,IAAAY,uBAAA,GAAAZ,OAAA;AAKA,IAAAa,QAAA,GAAAb,OAAA;AAUA,IAAAc,iBAAA,GAAAd,OAAA;AAaA,IAAAe,qBAAA,GAAAf,OAAA;AAeA,IAAAgB,oBAAA,GAAAhB,OAAA;AAaA,IAAAiB,kBAAA,GAAAjB,OAAA","ignoreList":[]}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.unsubscribeFromZustand = exports.unsubscribeFromStorage = exports.unsubscribeFromRoutes = exports.unsubscribeFromRender = exports.unsubscribeFromRedux = exports.unsubscribeFromReactQuery = exports.unsubscribeFromNetwork = exports.unsubscribeFromJotai = exports.unsubscribeAll = exports.unifiedEventStore = exports.subscribeToZustand = exports.subscribeToStorage = exports.subscribeToRoutes = exports.subscribeToRender = exports.subscribeToRedux = exports.subscribeToReactQuery = exports.subscribeToNetwork = exports.subscribeToJotai = exports.subscribeToAll = exports.subscribe = exports.isSourceSubscribed = exports.getSubscriptionStatus = exports.getSubscriberCounts = exports.getSourceCounts = exports.getEvents = exports.getEventCount = exports.getDiscoveredSources = exports.getAvailableEventSources = exports.getActiveSources = exports.clearEvents = void 0;
|
|
6
|
+
exports.unsubscribeFromZustand = exports.unsubscribeFromStorage = exports.unsubscribeFromRoutes = exports.unsubscribeFromRender = exports.unsubscribeFromRedux = exports.unsubscribeFromReactQuery = exports.unsubscribeFromNetwork = exports.unsubscribeFromJotai = exports.unsubscribeAll = exports.unifiedEventStore = exports.subscribeToZustand = exports.subscribeToStorage = exports.subscribeToRoutes = exports.subscribeToRender = exports.subscribeToRedux = exports.subscribeToReactQuery = exports.subscribeToNetwork = exports.subscribeToJotai = exports.subscribeToAll = exports.subscribe = exports.setLocalEnabledSources = exports.isSourceSubscribed = exports.getSubscriptionStatus = exports.getSubscriberCounts = exports.getSourceCounts = exports.getEvents = exports.getEventCount = exports.getDiscoveredSources = exports.getAvailableEventSources = exports.getActiveSources = exports.clearEvents = void 0;
|
|
7
7
|
var _autoDiscoverEventSources = require("../utils/autoDiscoverEventSources");
|
|
8
8
|
var _sourceIds = require("../sources/sourceIds");
|
|
9
9
|
/**
|
|
@@ -46,6 +46,20 @@ class UnifiedEventStore {
|
|
|
46
46
|
// the on-device consumer's subscriptions.
|
|
47
47
|
remoteDiscoveryIds = new Set();
|
|
48
48
|
|
|
49
|
+
// Discovery IDs the ON-DEVICE consumer (useUnifiedEvents) currently wants.
|
|
50
|
+
// The hook declares its desired set via setLocalEnabledSources() and the
|
|
51
|
+
// store diffs against this ledger, so any number of hook mounts / effect
|
|
52
|
+
// re-runs converge to at most ONE ref per source — and turning capture off
|
|
53
|
+
// releases exactly what is held. (The old imperative subscribeToX calls
|
|
54
|
+
// acquired a fresh ref on every mount while the power toggle released only
|
|
55
|
+
// one, so a closed-and-reopened tool kept capturing with capture "off".)
|
|
56
|
+
localDiscoveryIds = new Set();
|
|
57
|
+
|
|
58
|
+
// setLocalEnabledSources calls are serialized: subscribeToSource awaits a
|
|
59
|
+
// source's setup, and letting a second diff interleave with the first's
|
|
60
|
+
// in-flight subscribes can strand a ref outside the ledger.
|
|
61
|
+
localSyncChain = Promise.resolve();
|
|
62
|
+
|
|
49
63
|
// Map network event IDs to unified event IDs for updates
|
|
50
64
|
networkEventIdMap = new Map();
|
|
51
65
|
|
|
@@ -488,9 +502,47 @@ class UnifiedEventStore {
|
|
|
488
502
|
}
|
|
489
503
|
this.sourceUnsubscribers.clear();
|
|
490
504
|
|
|
491
|
-
// Clear active +
|
|
505
|
+
// Clear active + consumer bookkeeping (all subscriptions are gone).
|
|
492
506
|
this.activeSources.clear();
|
|
493
507
|
this.remoteDiscoveryIds.clear();
|
|
508
|
+
this.localDiscoveryIds.clear();
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
/**
|
|
512
|
+
* On-device consumer channel: useUnifiedEvents declares which event sources
|
|
513
|
+
* it wants captured (its enabled sources while capture is on, [] while it is
|
|
514
|
+
* off). Diffed against the local ledger so repeated declarations are
|
|
515
|
+
* idempotent — remounting the tool or enabling two sources that share a
|
|
516
|
+
* discovery source (react-query-query + react-query-mutation) never stacks
|
|
517
|
+
* refs the power toggle can't release. Ref-counting in the store still keeps
|
|
518
|
+
* a watching dashboard's subscriptions alive independently.
|
|
519
|
+
*/
|
|
520
|
+
setLocalEnabledSources(sources) {
|
|
521
|
+
const run = async () => {
|
|
522
|
+
const nextIds = new Set();
|
|
523
|
+
for (const src of sources) {
|
|
524
|
+
const id = _sourceIds.EVENT_SOURCE_TO_DISCOVERY_ID[src];
|
|
525
|
+
if (id) nextIds.add(id);
|
|
526
|
+
}
|
|
527
|
+
const prevIds = this.localDiscoveryIds;
|
|
528
|
+
this.localDiscoveryIds = nextIds;
|
|
529
|
+
const {
|
|
530
|
+
sources: discovered
|
|
531
|
+
} = (0, _autoDiscoverEventSources.getCachedDiscovery)();
|
|
532
|
+
for (const id of nextIds) {
|
|
533
|
+
if (!prevIds.has(id)) {
|
|
534
|
+
const source = discovered.find(s => s.id === id);
|
|
535
|
+
if (source) await this.subscribeToSource(source);
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
for (const id of prevIds) {
|
|
539
|
+
if (!nextIds.has(id)) {
|
|
540
|
+
this.unsubscribeFromSource(id);
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
};
|
|
544
|
+
this.localSyncChain = this.localSyncChain.then(run, run);
|
|
545
|
+
return this.localSyncChain;
|
|
494
546
|
}
|
|
495
547
|
|
|
496
548
|
/**
|
|
@@ -671,9 +723,11 @@ exports.isSourceSubscribed = isSourceSubscribed;
|
|
|
671
723
|
const getSubscriptionStatus = () => unifiedEventStore.getSubscriptionStatus();
|
|
672
724
|
exports.getSubscriptionStatus = getSubscriptionStatus;
|
|
673
725
|
const unsubscribeAll = () => unifiedEventStore.unsubscribeAll();
|
|
726
|
+
exports.unsubscribeAll = unsubscribeAll;
|
|
727
|
+
const setLocalEnabledSources = sources => unifiedEventStore.setLocalEnabledSources(sources);
|
|
674
728
|
|
|
675
729
|
// New exports for auto-discovery
|
|
676
|
-
exports.
|
|
730
|
+
exports.setLocalEnabledSources = setLocalEnabledSources;
|
|
677
731
|
const getDiscoveredSources = () => unifiedEventStore.getDiscoveredSources();
|
|
678
732
|
exports.getDiscoveredSources = getDiscoveredSources;
|
|
679
733
|
const getAvailableEventSources = () => unifiedEventStore.getAvailableEventSources();
|