Skip to content

Console duplicates requests within one cold load (sys_user_preference ×3–×6, meta/object ×2, meta/view ×2) #5544

Description

@os-zhuang

Tracked under objectstack-ai/cloud#1521 (performance epic). Dispatch round R1, parallel with the cloud-side cards — different repo, no territory overlap.

Console issues several requests to the same endpoint within a single cold load (page settles in 3.7s, far too short for pollers to fire a second time). Because the cloud control plane costs ~1.5s per DB-touching request (objectstack-ai/cloud#1518), each duplicate is both direct added latency and extra pressure on a concurrency knee.

Measured 2026-08-21

prod cloud.objectos.ai/_console/home, hard reload — 27 API calls, of which:

endpointcountindividual durations
/api/v1/data/sys_user_preference×32947 / 2913 / 2942 ms
/api/v1/meta/object×22590 / 4455 ms
/api/v1/meta/view×22609 / 4497 ms
/api/v1/auth/get-session×2831 / 1141 ms
/api/v1/runtime/config×2512 / 431 ms

staging cloud.objectos.app welcome, hard reload — 35 API calls, worse:

endpointcountindividual durations
/api/v1/data/sys_user_preference×68035 / 8027 / 7573 / 6511 / 7350 / 6242 ms
/api/v1/data/sys_notification_receipt×27945 / 7059 ms
/api/v1/data/sys_inbox_message×27819 / 6989 ms
/api/v1/auth/me/localization×24976 / 4483 ms
/api/v1/auth/get-session×22825 / 2377 ms
/api/v1/runtime/config×21414 / 629 ms

On staging, 15 of 35 calls are duplicates.

Why this is worth more than it looks

Server cost is ~1.5s per DB request on prod and ~6s on staging, and it degrades sharply past ~10 concurrent (cloud#1518 §2: at 20 concurrent the median goes from 1.9s to 4.4s). The home page already issues 27 concurrent calls. Removing these 6–15 duplicates saves their own latency and pulls total concurrency back under the knee — the benefit is doubled.

Where to look

sys_user_preference ×3 (prod) / ×6 (staging) is the most suspicious: it looks like several components independently fetching the same user preferences with no shared provider or request dedup. meta/object / meta/view ×2 look more like a MetadataProvider bootstrap effect re-running.

A similar class was fixed once before — AppHeader's notification/approval pollers were coalesced from ×5 to 1 with mountedRef + an in-flight guard (PR #1477). The same technique may apply, but these duplicates occur across different components, which likely calls for dedup at the request layer (in-flight requests sharing a Promise per key) rather than a guard inside each component.

Reproduce

Log in to cloud.objectos.ai, open /_console/home, hard reload, then:

constapi=performance.getEntriesByType('resource').filter(r=>r.name.startsWith(location.origin+'/api/'));constby={};for(constrofapi){constp=newURL(r.name).pathname;(by[p]||=[]).push(Math.round(r.duration));}Object.entries(by).filter(([,v])=>v.length>1);

Related: objectstack-ai/cloud#1518 (~1.5s fixed server cost per request).

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingdomain:uiobjectui ui stream: fix lands on the published library or apps — objectui execution seatpm:dispatched

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions