`useActionQuery({ resources })` narrows refetches by resource type only, not by resource id as the changelog says
Environment: @agent-native/core 0.229.0, main at adfa32747f (2026-11-16).
What the changelog says: the entry for d7da131 (#7314) in packages/core/CHANGELOG.md: "useActionQuery takes resources and useActionMutation takes resources, so a query tagged for a resource refetches only when a change to that resource lands".
What happens: the match is by type only. changedActionResourceTypes (packages/core/src/client/use-db-sync.ts:578) collects the resourceType of the incoming action events, and actionQueryAffectedByResources (packages/core/src/client/action-query-scope.ts:16) compares query tags against those types. resourceId is never consulted. So with changeResource on an action, an edit to program A refetches the open page of program B in every tab that can read programs. With org-wide visibility, that is every open tab of the organization.
Tagging a query with "program:<id>" does not work around it: the tag never equals the event's resourceType, so the query stops refetching at all.
What apps do instead: filter by id by hand through useDbSync({ actionInvalidatePredicate }), whose second argument carries the events with their resourceId. Content does it with eventChangesOnlyAnotherPage (templates/content/app/hooks/content-action-refresh.ts:343); Design passes its own predicate, shouldInvalidateDesignQueryForSync (templates/design/app/root.tsx:353, #6983).
Request:
- Let a query declare the record, not only the type, e.g.
resources: ["program:<id>"]next toresources: ["program"]. An event refetches atype:idquery when both itsresourceTypeand itsresourceIdmatch, and type-only tags keep today's behavior (lists). ShoulduseActionMutation({ resources })accept the same form for local invalidation? - Whatever is decided for 1, the docs are out of date:
packages/core/docs/content/client-data.mdxdocumentsactionInvalidatePredicateas(query: Query) => booleanand "Rarely needed"; the hook passes(query, events), and that second argument is what Content and Design rely on. The page also does not mentionresources.
The server side does not need to change: the event is small and only reaches people who can read the record anyway; the cost is in the refetch.
Thanks — once this fix merges, record-specific changes will refresh matching queries without refreshing unrelated records; it’s in review now.