Skip to content

fix: Clicking reload button in info panel may display fetched data in incorrect panel#3189

Merged
mtrezza merged 1 commit intoparse-community:alphafrom
mtrezza:fix/reload-panel
Feb 7, 2026
Merged

fix: Clicking reload button in info panel may display fetched data in incorrect panel#3189
mtrezza merged 1 commit intoparse-community:alphafrom
mtrezza:fix/reload-panel

Conversation

@mtrezza
Copy link
Member

@mtrezza mtrezza commented Feb 7, 2026

Pull Request

Issue

Clicking reload button in info panel may populate incorrect panel with fetched data.

Summary by CodeRabbit

  • Bug Fixes
    • Improved concurrent data fetch request handling to prevent stale data from being displayed.
    • Added automatic cancellation of outdated requests before initiating new ones.
    • Enhanced tracking mechanism to ensure data integrity when multiple requests are in flight.

@parse-github-assistant
Copy link

parse-github-assistant bot commented Feb 7, 2026

🚀 Thanks for opening this pull request!

@parseplatformorg
Copy link
Contributor

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@coderabbitai
Copy link

coderabbitai bot commented Feb 7, 2026

📝 Walkthrough

Walkthrough

Refactors info panel request management in Browser.react.js from a single query tracker to a per-objectId map, implementing cancellation logic and adding lastFetchedObjectId state for staleness detection. Propagates lastFetchedObjectId to DataBrowser to update how multiPanelData entries are keyed.

Changes

Cohort / File(s) Summary
Info Panel Request Management
src/dashboard/Data/Browser/Browser.react.js
Replaces currentInfoPanelQuery with infoPanelQueries map for per-object request tracking; adds lastFetchedObjectId state field and propagates it via props to DataBrowser; implements per-object request cancellation before initiating new requests and cleanup after completion.
Multi-Panel Data Keying
src/dashboard/Data/Browser/DataBrowser.react.js
Updates multiPanelData entry keying to use lastFetchedObjectId (from props) instead of selectedObjectId (from state), changing how AggregationPanelData updates map to multi-panel storage.

Sequence Diagram

sequenceDiagram
    participant User as User
    participant Browser as Browser.react.js
    participant DB as DataBrowser.react.js
    participant CloudFn as Cloud Function

    User->>Browser: Select Object A
    Browser->>Browser: Check infoPanelQueries[A]
    Note over Browser: Cancel existing request if present
    Browser->>CloudFn: Initiate info panel request (objectId: A)
    Browser->>Browser: Store promise in infoPanelQueries[A]

    User->>Browser: Select Object B (before A completes)
    Browser->>Browser: Check infoPanelQueries[B]
    Browser->>CloudFn: Initiate info panel request (objectId: B)
    Browser->>Browser: Cancel infoPanelQueries[A]
    Browser->>Browser: Store promise in infoPanelQueries[B]

    CloudFn-->>Browser: Return response for B
    Browser->>Browser: Set lastFetchedObjectId = B
    Browser->>Browser: Verify promise matches infoPanelQueries[B]
    Browser->>DB: Pass lastFetchedObjectId=B via props
    Browser->>Browser: Delete infoPanelQueries[B]

    DB->>DB: Update multiPanelData[B] with AggregationPanelData
    Note over DB: Keyed by lastFetchedObjectId instead of selectedObjectId
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description check ⚠️ Warning The description is incomplete. While the Issue section is filled out, the Approach section is missing (should describe the implementation strategy), and the Tasks section is incomplete (no checkboxes addressed). Add an Approach section explaining how the fix works (e.g., per-objectId request tracking and lastFetchedObjectId guard), and address relevant tasks like testing and documentation updates.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main fix: preventing incorrect panel population when reloading info panels, which aligns with the code changes that track lastFetchedObjectId to guard against stale responses.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

No actionable comments were generated in the recent review. 🎉

🧹 Recent nitpick comments
src/dashboard/Data/Browser/Browser.react.js (2)

385-386: Static analysis: forEach callback should not return a value.

The arrow function implicitly returns the result of q.cancel?.(). Use braces to suppress the return.

Proposed fix
-    Object.values(this.infoPanelQueries).forEach(q => q.cancel?.());
+    Object.values(this.infoPanelQueries).forEach(q => { q.cancel?.(); });

447-504: Per-objectId cancellation and staleness guard look correct.

The flow properly cancels any in-flight request for the same objectId before issuing a new one, guards against stale responses by comparing the stored promise reference, and cleans up in finally. This directly addresses the bug described in the PR.

One minor note: lastFetchedObjectId is not initialized in the constructor's this.state (lines 141–208). While it defaults to undefined and the consumer checks truthiness, explicitly initializing it (e.g., lastFetchedObjectId: undefined) improves readability and makes the state shape self-documenting.

Optional: initialize lastFetchedObjectId in state

Add to the state initialization block around line 197:

       errorAggregatedData: {},
+      lastFetchedObjectId: undefined,
       classFilters: {}, // Map of className -> filters array

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@mtrezza mtrezza changed the title fix: Clicking reload button in info panel may populate incorrect panel with fetched data fix: Clicking reload button in info panel may display fetched data in incorrect panel Feb 7, 2026
@mtrezza mtrezza merged commit b348ef5 into parse-community:alpha Feb 7, 2026
12 checks passed
@mtrezza mtrezza deleted the fix/reload-panel branch February 7, 2026 18:17
parseplatformorg pushed a commit that referenced this pull request Feb 7, 2026
# [8.5.0-alpha.3](8.5.0-alpha.2...8.5.0-alpha.3) (2026-02-07)

### Bug Fixes

* Clicking reload button in info panel may display fetched data in incorrect panel ([#3189](#3189)) ([b348ef5](b348ef5))
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 8.5.0-alpha.3

@parseplatformorg parseplatformorg added the state:released-alpha Released as alpha version label Feb 7, 2026
parseplatformorg pushed a commit that referenced this pull request Feb 12, 2026
# [8.5.0](8.4.0...8.5.0) (2026-02-12)

### Bug Fixes

* Auto-formatting not applied when Cloud Config parameter value is outdated and re-fetched from server ([#3182](#3182)) ([84eab36](84eab36))
* Clicking reload button in info panel may display fetched data in incorrect panel ([#3189](#3189)) ([b348ef5](b348ef5))
* Role linking in ACL fails with type error ([#3095](#3095)) ([2070d29](2070d29))
* Security migration from csurf to csrf-sync ([#3188](#3188)) ([a95d8a3](a95d8a3))
* View configuration dialog looses focus while typing and lacks syntax highlighting ([#3183](#3183)) ([715fe8d](715fe8d))

### Features

* Add keyboard shortcut to scroll info panels to top ([#3199](#3199)) ([7535626](7535626))
* Add option to reload all or only selected rows after invoking script ([#3200](#3200)) ([173b953](173b953))
* Add reload button to info panel on long loading time ([#3184](#3184)) ([3712d96](3712d96))
* Add support for script execution invoking dashboard form for user input ([#3201](#3201)) ([159f99d](159f99d))
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 8.5.0

@parseplatformorg parseplatformorg added the state:released Released as stable version label Feb 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

state:released Released as stable version state:released-alpha Released as alpha version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants