Skip to content

fix/dashboard-caching#529

Merged
shubhmjain30 merged 9 commits intodevfrom
fix/vp
Apr 10, 2026
Merged

fix/dashboard-caching#529
shubhmjain30 merged 9 commits intodevfrom
fix/vp

Conversation

@mohitmadaan-rgb
Copy link
Copy Markdown
Contributor

Description

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation Update (if none of the other choices apply)

🚨 Checklist:

  • Make sure you are requesting to pull your topic/feature/bugfix branch (right side). Don't request your master!
  • Make sure you are making a pull request against our dev branch (left side). Also, you should start your branch off our dev branch.
  • Your code follows the code style of this project.
  • Your change requires a change to the documentation.
  • You have updated the documentation accordingly.
  • You have read the Contributing Guide.
  • You have self-reviewed your code.
  • You have added unit-tests that prove my fix is effective or that my feature works.
  • Lint and unit-tests pass locally with your changes.
  • You have added necessary comments for complex logic.
  • Any dependent changes have been merged and published in downstream modules.

Further comments

🙏 Thank you!

Thank you for contributing to this project. We appreciate your time and effort. 🎉

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 26, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
wlc-webapp Ready Ready Preview, Comment Apr 10, 2026 6:00am
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
satin-uat Ignored Ignored Apr 10, 2026 6:00am

Request Review

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the performance and responsiveness of the admin dashboard by introducing comprehensive caching strategies. It leverages both in-memory and local storage caching for key dashboard components, ensuring faster data retrieval and a smoother user experience, while intelligently bypassing the cache for real-time "today's data." Additionally, it includes minor bug fixes for improved code robustness.

Highlights

  • Dashboard Caching Implementation: Introduced comprehensive caching mechanisms for key dashboard components (Earning Overview, Most Used Services, Success Rate, Usage Analytics) to significantly improve performance and reduce API calls.
  • Daily Cache Hook: Implemented a new useDailyCacheState hook for managing daily-expiring local storage cache, ensuring data freshness while leveraging caching benefits.
  • Real-time Data Handling: Ensured that 'today's data' on dashboards always fetches fresh information directly from the API, bypassing any cached data.
  • Shared Cache Key Utility: Refactored and centralized cache key generation into a new shared utility function (getCacheKey) for consistency across dashboard components.
  • Feature Flag Update: Modified the DEMO_ACCOUNT feature flag configuration to use forAdminOnly: true instead of forUserType: [1].
  • Safe Navigation Fixes: Applied minor bug fixes for safer property access in pricing forms and batch history components.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a multi-level caching strategy for several dashboard components, including Earning Overview, Most Used Services, Success Rate, and Usage Analytics. The caching mechanism prioritizes in-memory cache, then local storage, and always fetches fresh data for the current day. Additionally, the DEMO_ACCOUNT feature flag was updated to use forAdminOnly. Review feedback highlights a critical bug in PricingForm.jsx where destructuring param_attributes can lead to undefined values, a caching bug in MostUsedServices.tsx where the cache key does not include productFilter, an inconsistency in EarningOverview.jsx's local getCacheKey for date normalization, and significant code duplication across dashboard components' caching logic, suggesting a refactor into a shared custom hook.

Comment thread page-components/Admin/PricingConfig/PricingForm.jsx Outdated
@ekoindia ekoindia deleted a comment from gemini-code-assist bot Apr 1, 2026
response?.param_attributes !== null
) {
const { type, value } = response?.param_attributes && {};
const { type, value } = response?.param_attributes;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?? handles null + undefined
!== null only handles null

Destructuring requires object, otherwise runtime error

if (response?.status === 0) {
const { type, value } = response?.param_attributes ?? {};
}

@shubhmjain30 shubhmjain30 merged commit a2d9f59 into dev Apr 10, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants