fix(cf): stop app-detail remount + env-var refetch on every tab (#5519) - #5526
Merged
norman-abramovitz merged 1 commit intoJul 1, 2026
Conversation
Clicking between an app's side tabs (Summary/Logs/Variables/...) tore down and rebuilt ApplicationBaseComponent every time, because CustomReuseStrategy reused a route only when a reuseRoute marker matched — and the app-detail routes carried none. Each rebuild re-ran the eager data load, including the env-vars fetch, which emits an audit.app.environment.show event. Clicking around thus spammed the app's event feed. A plain reuseRoute marker can't be used here: ApplicationBaseComponent derives its CF/app GUIDs from route params at construction, so reusing it across two different apps (A -> B) would leave it pinned to app A. So teach the component-keyed branch of shouldReuseRoute to also require the route node's own params to match: same params (tab switch) reuses the shell; different params (different app) rebuilds. Then mark the app-detail shell + tabs-base routes. This also fixes the same latent staleness for the k8s helm-release shell, which uses the identical construction-time-guid pattern. Adds route-reuse-stragegy.spec.ts covering the param-aware reuse.
nabramovitz
force-pushed
the
norm/fix/5519-app-tab-envvars
branch
from
July 1, 2026 13:44
92f759a to
043b8a4
Compare
4 tasks
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.
Closes #5519
Problem
Clicking between an application's side tabs (Summary, Log Stream, Revisions, Routes, Variables, Services, Events) triggers a fetch of
/v3/apps/:guid/environment_variablesevery time, each emitting anaudit.app.environment.showevent and polluting the app's event feed. Env vars should only be fetched for the Variables tab.Root cause
CustomReuseStrategyreuses a route only when areuseRoutemarker matches; the app-detail routes carried none, so every tab navigation tore down and rebuiltApplicationBaseComponent. ItsngOnInitre-runs the eager data load (refresh('all')), which includes the env-vars fetch → an audit event per tab click.A plain
reuseRoutemarker can't be used directly here:ApplicationBaseComponentderives its CF/app GUIDs from route params via construction-time DI factories, so reusing the instance across two different apps (A → B) would leave it pinned to app A's data.Fix
Teach the component-keyed branch of
shouldReuseRouteto also require the route node's own params to match:Then mark the app-detail shell (
ApplicationBaseComponent) and tabs-base (ApplicationTabsBaseComponent) routes. Also fixes the same latent cross-resource staleness for the k8s helm-release shell, which uses the identical construction-time-guid pattern (verified). Addsroute-reuse-stragegy.spec.tscovering param-aware reuse.Verification
Strategy unit tests (4/4) cover reuse-on-same-params and rebuild-on-different-params. End-to-end live verification (clicking tabs, confirming the env-vars call no longer fires and the event feed stays clean) is pending an available CF endpoint and should be done before merge.