home page events also render in proper way#131
Conversation
|
@Ashitosh0302 is attempting to deploy a commit to the niharika-mente's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughThis PR modifies app/page.tsx to await searchParams before calling getAllEvents with query/mode/tag filters, destructures events from the result, and wraps the SearchFilters UI in a Suspense boundary with a skeleton fallback. Separately, lib/mongodb.ts adds a serverSelectionTimeoutMS option to mongoose.connect. ChangesHome page wiring and MongoDB timeout config
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 1 | ❌ 4❌ Failed checks (3 warnings, 1 inconclusive)
✅ Passed checks (1 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.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
app/page.tsx (1)
20-24: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winPass
sortBythrough on the home page.
SearchFiltersrenders a sort dropdown that writessortByto the URL, but this page ignores it when callinggetAllEvents, so sorting appears broken on the home page.Proposed fix
interface PageProps { searchParams: Promise<{ query?: string; mode?: string; tag?: string; + sortBy?: string; }>; } + +const VALID_SORT = ["date_asc", "date_desc", "name_asc", "name_desc", "popularity"] as const; +type SortByType = (typeof VALID_SORT)[number]; const Page = async ({ searchParams }: PageProps) => { const resolvedParams = await searchParams; + const rawSortBy = resolvedParams.sortBy?.trim(); + const sortBy = VALID_SORT.includes(rawSortBy as SortByType) + ? (rawSortBy as SortByType) + : undefined; const { events } = await getAllEvents({ query: resolvedParams.query, mode: resolvedParams.mode, tag: resolvedParams.tag, + sortBy, });🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@app/page.tsx` around lines 20 - 24, The home page is dropping the `sortBy` query value when calling `getAllEvents`, so the `SearchFilters` sort dropdown has no effect. Update the `app/page.tsx` data-fetching logic to read `resolvedParams.sortBy` and pass it through alongside `query`, `mode`, and `tag` in the `getAllEvents` call, keeping the existing `SearchFilters` URL state and `getAllEvents` behavior aligned.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@lib/actions/event.actions.ts`:
- Around line 41-43: In the event pagination flow inside the event actions logic
(the safePage/safeLimit/skip calculation used by the event listing/count path),
the page is being used to compute skip before it is clamped against the actual
total pages, which can produce an empty result set while exposing an
out-of-range currentPage. Reorder the flow so the total matching event count is
computed first, totalPages is derived, then currentPage/page is clamped to that
range, and only after that should skip be calculated and used by the event query
in the affected event listing methods.
In `@lib/mongodb.ts`:
- Line 63: The MongoDB client setup currently hard-codes a 5-second server
selection timeout, which should be configurable instead of fixed. Update the
connection options in mongodb.ts so the timeout value comes from a config/env
source used by the MongoDB bootstrap code, and keep the existing fallback
behavior if no override is provided. Make sure the change is applied where the
MongoDB client is created so callers like getAllEvents and
getSimilarEventsBySlug can benefit from a tunable timeout during slow startup or
failover scenarios.
---
Outside diff comments:
In `@app/page.tsx`:
- Around line 20-24: The home page is dropping the `sortBy` query value when
calling `getAllEvents`, so the `SearchFilters` sort dropdown has no effect.
Update the `app/page.tsx` data-fetching logic to read `resolvedParams.sortBy`
and pass it through alongside `query`, `mode`, and `tag` in the `getAllEvents`
call, keeping the existing `SearchFilters` URL state and `getAllEvents` behavior
aligned.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 89dafd90-8e55-48d2-9654-d781acfa7d2d
📒 Files selected for processing (4)
app/page.tsxlib/actions/event.actions.tslib/mongodb.tstsconfig.json
|
@Ashitosh0302, Write a proper PR title and description! |
|
I make the changes and add fix issues in the PR |
|
I make the changes
…On Wed, Jul 1, 2026 at 2:23 PM Tarunya K ***@***.***> wrote:
*TarunyaProgrammer* left a comment (niharika-mente/DevEvent_Tracker#131)
<#131 (comment)>
@Ashitosh0302 <https://github.com/Ashitosh0302>, Write a proper PR title
and description!
—
Reply to this email directly, view it on GitHub
<#131?email_source=notifications&email_token=BVQN2VWCYCZHPQ3WBJTV5VD5CTGO5A5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTIOBVGIZTKOJVGE3KM4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJLDGN5XXIZLSL5RWY2LDNM#issuecomment-4852359516>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BVQN2VVGHGFFU52VWSYT46D5CTGO5AVCNFSNUABGKJSXA33TNF2G64TZHMYTCMZXGY3TAMBXGM5US43TOVSTWNBXGY3TEMRWGU2DLILWAI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
|
This branch has conflicts that must be resolved app/page.tsx |
|
I solved the merge conflicts all |
|
I have fixed the issue.
…On Wed, Jul 1, 2026 at 5:51 PM Satyam Pandey ***@***.***> wrote:
*SatyamPandey-07* left a comment (niharika-mente/DevEvent_Tracker#131)
<#131 (comment)>
This branch has conflicts that must be resolved
Use the web editor
<https://github.com/niharika-mente/DevEvent_Tracker/pull/131/conflicts>
or the command line to resolve conflicts before continuing.
app/page.tsx
lib/actions/event.actions.ts @Ashitosh0302
<https://github.com/Ashitosh0302>
—
Reply to this email directly, view it on GitHub
<#131?email_source=notifications&email_token=BVQN2VTLZJDK2OIGZIIQUL35CT653A5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTIOBVGQ3TCMJZGI3KM4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJLDGN5XXIZLSL5RWY2LDNM#issuecomment-4854711926>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BVQN2VW7MW64MXXJYYMPFG35CT653AVCNFSNUABGKJSXA33TNF2G64TZHMYTCMZXGY3TAMBXGM5US43TOVSTWNBXGY3TEMRWGU2DLILWAI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
|
Awesome, thanks!
…On Thu, 2 Jul, 2026, 5:58 pm Satyam Pandey, ***@***.***> wrote:
Merged #131 <#131>
into main.
—
Reply to this email directly, view it on GitHub
<#131?email_source=notifications&email_token=BVQN2VSSMCBXN6HD3U6DVKD5CZIOJA5CNFSNUABQM5UWIORPF5TWS5BNNB2WEL2JONZXKZKFOZSW45CON52GSZTJMNQXI2LPNYXTENZUG44DGNBQGQ4DPJTSMVQXG33OU5WWK3TUNFXW5JLFOZSW45FMMZXW65DFOJPWG3DJMNVQ#event-27478340487>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BVQN2VQABRFSMDSEMS4ZOV35CZIOJAVCNFSNUABGKJSXA33TNF2G64TZHMYTCMZXGY3TAMBXGM5US43TOVSTWNBXGY3TEMRWGU2DLILWAI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***
com>
|
Description
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context.
Fixes #114 #125
Type of Change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce.
Checklist:
#add the events in the home page also
Summary by CodeRabbit
New Features
Bug Fixes