-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
fix: Prefetch for multiple info panels in data browser doesn't refresh stale cached data #3080
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Prefetch for multiple info panels in data browser doesn't refresh stale cached data #3080
Conversation
|
🚀 Thanks for opening this pull request! We appreciate your effort in improving the project. Please let us know once your pull request is ready for review. |
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
📝 WalkthroughWalkthroughThe PR enhances DataBrowser's batch navigation and prefetch caching logic. It adds timestamp-based cache maintenance to clean stale prefetch entries, introduces a Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes
Possibly related PRs
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/dashboard/Data/Browser/DataBrowser.react.js (1)
1387-1397: Consider simplifyingneedsPrefetchsince stale entries are pre-cleaned.The helper function is a good abstraction. However, since stale entries are already deleted in the cleanup loop above (lines 1376-1381), the stale check inside
needsPrefetch(lines 1392-1395) will never evaluate to true—the stale entries no longer exist incacheby the time this helper is called.This is defensively correct but slightly redundant. You could simplify to just check cache membership, or keep it as-is for future-proofing if the cleanup logic ever changes.
const needsPrefetch = (objectId) => { - if (!Object.prototype.hasOwnProperty.call(cache, objectId)) { - return true; - } - if (prefetchStale) { - const entry = cache[objectId]; - return entry && (now - entry.timestamp) / 1000 >= prefetchStale; - } - return false; + return !Object.prototype.hasOwnProperty.call(cache, objectId); };
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/dashboard/Data/Browser/DataBrowser.react.js(5 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-12-13T19:47:18.023Z
Learnt from: mtrezza
Repo: parse-community/parse-dashboard PR: 0
File: :0-0
Timestamp: 2025-12-13T19:47:18.023Z
Learning: In Parse Dashboard DataBrowser, the panel header context menu uses the hardcoded 'objectId' field when filtering scripts via `getValidScripts` because the panel header represents the entire object, not a specific field. Field-specific script execution happens when right-clicking on individual table cells in BrowserCell.
Applied to files:
src/dashboard/Data/Browser/DataBrowser.react.js
📚 Learning: 2025-07-31T06:12:17.707Z
Learnt from: mtrezza
Repo: parse-community/parse-dashboard PR: 2957
File: src/dashboard/Data/Browser/BrowserTable.react.js:584-597
Timestamp: 2025-07-31T06:12:17.707Z
Learning: In Parse Dashboard's data browser selection logic (src/dashboard/Data/Browser/BrowserTable.react.js), the `selection['*']` pattern is used to handle global operations that pass `{ '*': true }` to indicate all items are selected, particularly for bulk operations like delete. This is not dead code but serves as compatibility layer for global operations that don't go through normal individual row selection workflows.
Applied to files:
src/dashboard/Data/Browser/DataBrowser.react.js
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Docker linux/amd64
🔇 Additional comments (3)
src/dashboard/Data/Browser/DataBrowser.react.js (3)
960-964: LGTM! Clear optimization for batch navigation prefetch utilization.The condition change ensures the batch is always rebuilt when
batchNavigateis enabled, positioning the selected object at the start of the batch. This aligns with the navigation step size (jumping bypanelCount) and enables proper utilization of prefetched data for subsequent batches.
1421-1423: Clean refactoring using the helper function.Good use of the
needsPrefetchhelper to make the prefetch decision more readable and consistent with the batch object check below.
1430-1432: Consistent use of the helper for batch object prefetch decisions.
# [8.2.0-alpha.9](8.2.0-alpha.8...8.2.0-alpha.9) (2025-12-16) ### Bug Fixes * Prefetch for multiple info panels in data browser doesn't refresh stale cached data ([#3080](#3080)) ([e71d4e6](e71d4e6))
|
🎉 This change has been released in version 8.2.0-alpha.9 |
New Pull Request Checklist
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.