Skip to content
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

[Bug] Excessive notification polling causing redundant network requests in Admin UI #10887

Open
peerapatzimpligital opened this issue Jan 9, 2025 · 2 comments

Comments

@peerapatzimpligital
Copy link

Bug report

Describe the bug

The Medusa admin dashboard is making excessive network requests to fetch notifications. Every few seconds, multiple requests are being made to the notifications endpoint, potentially impacting performance and creating unnecessary server load.

System information

  • Medusa version: Latest
  • Node.js version: v20.16
  • Database: PostgreSQL
  • Operating system: macOS
  • Browser: Chrome

Steps to reproduce the behavior

  1. Log into Medusa admin dashboard
  2. Create or accumulate approximately 100+ notifications in the system
  3. Open browser developer tools (Network tab)
  4. Click notification icons on right side top bar.
  5. Observe continuous requests to /admin/notifications endpoint
  6. Notice multiple concurrent requests being made frequently, each fetching large amounts of data

Expected behavior

  • Notification requests should be properly debounced/throttled
  • Requests should only be made when necessary (e.g., when notification panel is open)
  • Should implement proper caching to reduce server load
  • Should avoid duplicate requests within short time intervals

Screenshots

Screen.Recording.2568-01-09.at.13.20.11.mp4

Code snippets

/** Current problematic implementation

  • @medusajs/admin-bundler/node_modules/.vite/deps/@medusajs_dashboard.js

    endObserver.current = new IntersectionObserver((entries) => {
    if (entries[0].isIntersecting && hasNextPage) {
    ** Commenting out this function stops the excessive requests
    // fetchNextPage();
    }
    });

Additional context

  • Issue becomes more pronounced when notification count more than ~100 records
@peerapatzimpligital
Copy link
Author

Hi, just checking if there are any updates.

@cuong88pham
Copy link

Hi i get same issue

Screen.Recording.2025-01-22.at.9.29.47.PM.mov

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants