fix(client): coalesce catalog refetches after event bursts - #47927
Open
Hona wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A 33-minute Desktop netlog showed
GET /api/modelfetched 16 times (~270 KB each, 4.3 MB decoded) andGET /api/provider16 times. One Location's model and provider catalogs were fetched three times within ~190 ms becausecatalog.updated,integration.updated, andcredential.updatedeach answered with an immediate refetch./api/command(24),/api/mcp/resource(22),/api/agent,/api/skill, and/api/referencesaw the same burst pattern.Changes —
packages/client/src/solid/data.tssettle(key, load)instead ofrefresh(load):catalog.updated,integration.updated,credential.updated,credential.switched,agent.updated,command.updated,skill.updated,reference.updated,config.updated,websearch.updated, andmcp.resources.changed.location.<field>:<locationKey>, so different events that ask for the same catalog share one timer.catalog.updatedandintegration.updatedfor the same Location now coalesce into one model fetch and one provider fetch.invalidate(...)still runs immediately, so an explicitsync()during the window reads fresh data and already-published data stays visible until the reload lands. Session, permission, form, shell, and VCS handling is unchanged.catalog.updated+integration.updated+credential.updatedfor one Location in ~190 msGET /api/model, 3 ×GET /api/providerGET /api/model, 1 ×GET /api/providerGET /api/model(4.3 MB decoded), 16 ×GET /api/provider/api/command,/api/mcp/resource,/api/agent,/api/skill,/api/referenceFollows #47561, which introduced
settleformcp.status.changed.