Repository navigation
fix(mfe): refresh drilldown pagination from history - #258
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Central YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (2)
🔗 Linked repositories identifiedCodeRabbit considers these linked repositories for cross-repo context during reviews:
Included review availability: Your plan provides up to 100 included reviews per hour; 84 remain after this review. 📜 Recent review details🔇 Additional comments (2)
📝 WalkthroughWalkthrough
Priority: ➖ Normal Severity of issue fixed: Medium Merge Risk: 🔵 Low · up to With multiple embedded portals, a variable change in one portal can refresh another dashboard with the wrong values. The impact is bounded to that multi-portal interaction, but should be addressed or explicitly accepted before merge. 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
A rabbit hops where page numbers turn Comment |
|
Reviewed the multi-portal risk noted in the summary. The regression mounts parent and child together and asserts only the owning child receives the exact variable delta; parent query parameters and host input remain unchanged. It also covers consecutive paging, host echo without duplicate refresh, host reset, and unsubscribe. Host routing/UID remains authoritative, and this change does not alter server-side query scope or credentials. Keeping the narrow fix; production acceptance will repeat child paging and parent close/reopen behavior after deployment. |
Summary
Fix query pagination in the embedded comment drilldown without refreshing the parent dashboard or adding a global refresh mechanism.
The live Major drilldown returned A=10 rows and B=11,523 with HTTP200. Next/Previous changed the URL offset and enabled pagination controls, but emitted no new
/grafana/api/ds/queryrequest and left the same rows visible. Parent IDE pagination does issue a new query; this is not a claim that all pagination was broken.Cause and fix
RenderFNDashboardsampled Grafana history only during host-prop renders and passed only host query parameters toDashboardPage. BusinessTable changes Grafana history directly. The child portal therefore missed the variable-change refresh boundary. Additionally,fnPathnameChangemutates the shared history location in place.Subscribe to history for the currently owning portal, apply only changed
var-*keys to its local query snapshot, and pass an immutable search snapshot to the existing realDashboardPagevariable-change path. Host updates supersede the local snapshot; unchanged host echoes do not trigger another refresh. Preserve host uid and non-variable routing props; do not merge the entire shared URL. Unsubscribe on cleanup. No backend, authorization, SQL, result-limit, or deployment changes.Validation
templateVarsChangedInUrlcall, received zero.@prometheus-io/lezer-promql. No dependency changes are included; production container CI remains the artifact build gate.npm run typecheckreports122 errors in95 unchanged files, none in this patch. Normalized error lines exactly match the existing Fix cross-dashboard cancellation when closing drill-downs #257 final typecheck log (122/122, no added/removed errors); this comparison reuses that recorded baseline, not a fresh baseline run.Rollout and rollback
Based on merged #257 (
c09763ea2d). Neither #257 nor this fix is implied deployed by the mono dashboard-template releases. After review/CI and explicit deployment authorization, publish the Grafana base and verify exact regional derived-image provenance before testing child Next/Previous, page-size changes, close/reopen, and parent refresh overlap. Reverting this commit retains #257; no production dispatch is part of this PR.Agent handoff
public/app/fn-app/fn-dashboard-page/render-fn-dashboard.tsxandpublic/app/features/dashboard/containers/DashboardPageLoading.test.tsx./tmp/grafana-mfe-pagination-history,codex/grafana-mfe-pagination-history.git status --short && git diff origin/coderabbit_micro_frontend...HEAD --stat.node node_modules/jest/bin/jest.js public/app/features/dashboard/containers/DashboardPageLoading.test.tsx public/app/fn-app/fn-dashboard-page/fn-dashboard.test.tsx public/app/fn-app/create-mfe.test.tsx --runInBand --watch=false.Summary by CodeRabbit