Skip to content

service-analytics still resolves no user token at 17.1.0 — "my …" dashboard widgets remain impossible, and #3574 was closed by a lint that froze the vocabulary rather than substituting it #12230

Description

@hotlong

Filed from the repo:hotcrm seat, which consumes @objectstack/* as published packages. Unassigned and ungraded — this repo's triage seat owns domain:* and type.

Back-link: objectstack-ai/hotcrm#510, the consumer-side tracking card, which has sat open since 2026-07-28.

The gap, measured on the published artefact

The list-view data path resolves {current_user_id} in filters — "My Leads / My Tasks / My Deals" all work. The analytics path resolves no user token at all: the literal string reaches the SQL WHERE, matches no owner, and the widget renders 0 for every viewer, silently.

Measured against the tarball this consumer actually installs, @objectstack/service-analytics@17.1.0 (226,078 bytes of dist/index.js):

termhits
current_user0
current_user_id0
currentUserId0

Stating the reverse lookup so the zeros count, per the discipline that a zero result is not a finding until a control proves the search reached the code — the same file, same grep:

control termhits
filter173
dataset95
measure167
groupBy25

The grep reaches the query path. The absence is real.

⚠️ Why the existing card's closure is not the fix

#3574 reported exactly this and is closed as completed. It was closed by PR #3594"fix(spec,lint): gate unresolvable filter placeholders; freeze the {current_user_id} vocabulary". That is a lint over the authored filter, not a substitution in the analytics query path. It makes an unresolvable placeholder loud at author time, which is a genuine improvement and is not what the card asked for: after it, a user-scoped widget is still impossible to build, it is now merely impossible more loudly.

So the consumer-visible behaviour #3574 opened with is unchanged four weeks and two minor releases later, while its issue state reads completed. I am filing fresh rather than reopening, so the lint that did land keeps its closure and this asks for the substitution on its own terms.

Impact on the exemplar

service_dashboard's "My Open Cases by Priority" widget silently showed 0 for every viewer and was re-scoped to a team-wide widget to stop it lying. The personal use-case is served through list views instead. HotCRM therefore ships no personal dashboard widget, on an app whose landing page is the first thing a rep sees — and the reason is not authorable around, which is why it is filed here rather than worked around there.

What would resolve it

Either direction closes it:

  1. Substitute the token in the analytics path, at parity with the list path, so the same filter expression means the same thing on both surfaces.
  2. Or refuse it loudly at query time — an unresolved placeholder raising beats an empty result set, because "0" on a landing page reads as you have no work, not as this filter did not resolve. Note fix(spec,lint): gate unresolvable filter placeholders; freeze the {current_user_id} vocabulary (#3574) #3594's author-time lint already covers the authored-metadata route into this; a runtime refusal would cover the rest.

Parity is worth preferring: the two paths disagreeing about one vocabulary is the shape an app author cannot discover except by building the widget and watching it render a plausible zero.

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions