You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by "wu-sheng (via GitHub)" <gi...@apache.org> on 2026/08/01 02:59:00 UTC

[PR] fix: clear cached data on identity change, carry exact service identity, cascade-clear traces [skywalking-horizon-ui]

wu-sheng opened a new pull request, #105:
URL: https://github.com/apache/skywalking-horizon-ui/pull/105

   ## Why
   
   Four defects found in review. The first is the one to look at closely: it is the only cross-user data exposure.
   
   **Cached data outlived the session.** The global query cache was never cleared on logout, on login, or on a mid-session 401, and some entries never go stale. So after user A signed out and user B signed in **in the same tab**, user B could be served user A's service lists, alarms, traces and dashboards. On a shared workstation or a support laptop that is a real disclosure, not a theoretical one.
   
   **Service identity was not exact.** OAP can hold a normal and a virtual service under the same name. The instance and endpoint routes took an ambiguous `service=` argument, and routed traces, logs and browser errors took an id the UI already held and converted it back into a **name** before querying — so the wrong entity could answer.
   
   **Alarms threw away the identity the BFF supplied.** It sent `{name, normal}`, the UI reduced it to names, and the alarm query then hardcoded `normal: true`, so alarms for a virtual service could be wrong or missing entirely.
   
   **Traces could stay attached to the previous service.** Switching service cleared the instance and endpoint fields but left the committed query state, so the previous service's results remained on screen as if they belonged to the new one — the Logs and Browser-errors views already handled this correctly.
   
   ## What
   
   Cached data is **removed** on every identity change — explicit logout, fresh login, and a 401 that ends the session mid-flight — rather than marked stale, so neither a cached entry nor a response already in flight under the old identity can paint.
   
   An id the UI holds now travels as an id end to end; `service=` on the instance and endpoint routes is split into explicit id and name parameters. A name is resolved only when a name is genuinely all the caller has, and the normal/virtual distinction is carried rather than guessed.
   
   The alarm filter keeps `{name, normal}` and the query uses the caller's flag instead of a constant. The filter UX is unchanged — the operator picks a service, not a service and a boolean.
   
   The Traces view resets its committed query state on a service switch, matching the sibling views and the cascade-clear rule in `CLAUDE.md`.
   
   ## Validation
   
   `pnpm -r run type-check`, `pnpm lint` (ESLint, source budget, both i18n gates, the bundled-template validator), `pnpm -r run test:unit` (**984 tests**) and `pnpm license:check` (688/0) all pass.
   
   Each behavior change carries a test that fails on the old behavior, mutation-checked by reverting the fix and confirming the test goes red.
   
   ## Known gap, tracked separately
   
   Admin **layer** template content still reaches OAP unvalidated (overview and infra-3D are validated). A save-time check was tried and reverted because it rejected the editor's own `+ Add widget` seed, which carries an empty expression — an operator who added a widget could not publish until every expression was filled. The right boundary is the **push/sync to OAP** step rather than save: a local draft stays free-form while it is being edited, and validation runs when the template is published. That belongs in its own change.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix: carry service identity as an {id, name} pair, validate layer publishes, and stop bundled fallback in live mode [skywalking-horizon-ui]

Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng merged PR #105:
URL: https://github.com/apache/skywalking-horizon-ui/pull/105


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org