mirror of
https://github.com/getpaseo/paseo.git
synced 2026-08-15 04:42:45 +00:00
refactor(app): centralize perf diagnostics and activity coalescing
This commit is contained in:
@@ -205,6 +205,9 @@ function SessionProviderInternal({
|
||||
const setAgentLastActivity = useSessionStore(
|
||||
(state) => state.setAgentLastActivity
|
||||
);
|
||||
const flushAgentLastActivity = useSessionStore(
|
||||
(state) => state.flushAgentLastActivity
|
||||
);
|
||||
const setPendingPermissions = useSessionStore(
|
||||
(state) => state.setPendingPermissions
|
||||
);
|
||||
@@ -376,10 +379,11 @@ function SessionProviderInternal({
|
||||
// If the client drops mid-initialization, clear pending flags
|
||||
useEffect(() => {
|
||||
if (!isConnected) {
|
||||
flushAgentLastActivity();
|
||||
pendingAgentUpdatesRef.current.clear();
|
||||
setInitializingAgents(serverId, new Map());
|
||||
}
|
||||
}, [serverId, isConnected, setInitializingAgents]);
|
||||
}, [flushAgentLastActivity, serverId, isConnected, setInitializingAgents]);
|
||||
|
||||
const applyAgentUpdatePayload = useCallback(
|
||||
(update: AgentUpdatePayload) => {
|
||||
@@ -430,7 +434,6 @@ function SessionProviderInternal({
|
||||
next.delete(agentId);
|
||||
return next;
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user