Skip to content

feat: add duplicate schedule lock, cross-tab sync, tab validation and debounce#450

Merged
PRODHOSH merged 1 commit into
PRODHOSH:mainfrom
DebasmitaBose0:feat/419-duplicate-route-tab-validation
Jul 14, 2026
Merged

feat: add duplicate schedule lock, cross-tab sync, tab validation and debounce#450
PRODHOSH merged 1 commit into
PRODHOSH:mainfrom
DebasmitaBose0:feat/419-duplicate-route-tab-validation

Conversation

@DebasmitaBose0

Copy link
Copy Markdown
Contributor

Closes #419

Summary

Prevents duplicate scheduled refresh runs, adds cross-tab state sync, and validates tab query parameters with debounced switching.

Changes

  • supabase/migrations/20260714000000_add_scheduler_locks.sql — new scheduler_locks table for exclusive cron locks
  • supabase/functions/scheduled-refresh/index.ts — acquire/release lock via upsert; skips if concurrent run active; release on error
  • src/hooks/useBroadcastChannel.ts — new: BroadcastChannel API hook for cross-tab communication
  • src/hooks/useVisibility.ts — new: visibilitychange listener hook
  • src/components/profile/ProfileView.tsx — debounced tab switching (150ms), cross-tab refresh sync via BroadcastChannel, pause relative-time updates on tab hide
  • src/app/explore/page.tsx — whitelist validation for sortBy and type query params

@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@DebasmitaBose0, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 45 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 4dd5aab5-3671-43e8-a599-801b2d38eb80

📥 Commits

Reviewing files that changed from the base of the PR and between 294511e and 4385b05.

📒 Files selected for processing (6)
  • src/app/explore/page.tsx
  • src/components/profile/ProfileView.tsx
  • src/hooks/useBroadcastChannel.ts
  • src/hooks/useVisibility.ts
  • supabase/functions/scheduled-refresh/index.ts
  • supabase/migrations/20260714000000_add_scheduler_locks.sql
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@github-actions github-actions Bot added frontend Related to UI / Next.js backend Supabase / API / database UI Visual / design changes labels Jul 13, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Welcome to OSSfolio, @DebasmitaBose0! 🎉

Thank you for opening this pull request and contributing to the open-source community! 🚀

To ensure a smooth review process, please make sure you have:

  • Checked that your changes work locally and compile cleanly.
  • Followed the guidelines outlined in CONTRIBUTING.md.
  • Linked your PR to an open issue (e.g. Closes #ISSUE_NUMBER).

We will review your PR as soon as possible. Happy coding! 💻✨

@PRODHOSH PRODHOSH self-requested a review July 14, 2026 03:07
@PRODHOSH PRODHOSH added ELUSOC ELUSOC project submission completed ADVENTURER Intermediate — 25 pts labels Jul 14, 2026
@PRODHOSH PRODHOSH merged commit 45ccfbe into PRODHOSH:main Jul 14, 2026
8 of 9 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

🎉 Your PR just got merged, @DebasmitaBose0 — thank you for contributing to OSSfolio!

Your work is now part of the project. Here's what to do next:

  • ⭐ If you haven't already, consider giving the repo a star — it helps us grow.
  • 📢 Share your contribution on LinkedIn, Twitter, or wherever you hang out. You shipped open source!
  • 🔍 Browse other open issues if you want to keep contributing.

We really appreciate you taking the time. See you in the next PR! 🚀

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

Labels

ADVENTURER Intermediate — 25 pts backend Supabase / API / database completed ELUSOC ELUSOC project submission frontend Related to UI / Next.js UI Visual / design changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ELUSOC] Duplicate Schedule Route & Tab Validation

2 participants