Skip to content

Feature/events pagination filtering#621

Merged
ritik4ever merged 4 commits into
ritik4ever:mainfrom
Shadow-MMN:feature/events-pagination-filtering
Jun 30, 2026
Merged

Feature/events pagination filtering#621
ritik4ever merged 4 commits into
ritik4ever:mainfrom
Shadow-MMN:feature/events-pagination-filtering

Conversation

@Shadow-MMN

Copy link
Copy Markdown

What changed

  • Added ?pageSize, ?streamId, and ?since query parameters to GET /api/events
  • Updated getGlobalEvents() and countAllEvents() in eventHistory.ts to support the new filters with AND composition
  • Added pageSize, streamId, and since fields to listEventsQuerySchema in schemas.ts (kept limit as a backwards-compatible alias)
  • Changed default behavior to always paginate (page=1, pageSize=20) instead of returning all events when params are omitted
  • Documented the endpoint with all parameters in Swagger

Testing done

  • Ran all 12 Global Events integration tests — all pass (6 existing + 6 new)
  • New tests: streamId filter, since timestamp filter, pageSize parameter, combined eventType + streamId, combined eventType + streamId + since, pagination with pageSize

Related issues

Closes #380

Checklist

  • I kept the change focused on the related issue.
  • I added or updated tests where useful.
  • I updated documentation where behavior changed.
  • I verified the app still builds or explained why verification was skipped.

Shadow-MMN added 4 commits June 28, 2026 17:41
- Add ?pageSize, ?streamId, and ?since query parameters
- Updated getGlobalEvents and countAllEvents to support all filters
- Updated listEventsQuerySchema with new optional fields
- Changed default pagination to use pageSize=20 instead of returning all
- Added Swagger documentation for the endpoint
- Added integration tests covering each filter independently and combined

Closes ritik4ever#380
…nts schema

- Add 'completed' to VALID_EVENT_TYPES in schemas.ts and the swagger
  eventType enum to match the handler's accepted StreamEventType values
- Add 400 error response to /api/events swagger definition
- Reject blank streamId values (e.g. streamId=) at the schema boundary
  while keeping the field optional when omitted entirely
- streamStore.updateStartAt.test.ts: await async updateStreamStartAt calls
- streamStore.progress.test.ts: cap elapsedSeconds at duration, handle zero duration
- eventHistory.test.ts: pass asc order explicitly to getStreamHistory calls
- streamStore.test.ts, streamStore.reconcile.test.ts: mock logger module
- cors.test.ts: remove duplicate app.use(cors()) causing origin override
- requestLogger.test.ts: mock setHeader in first test case
- Add syncFtsIndex to dbMocks in 3 test files
@vercel

vercel Bot commented Jun 28, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the ritik4ever's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Jun 28, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@Shadow-MMN, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 23 minutes and 53 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more credits in the billing tab to continue.

⌛ How to resolve this issue?

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 credits.

🚦 How do rate 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 see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: df4d37da-bef9-47b4-9511-0c2b3036385e

📥 Commits

Reviewing files that changed from the base of the PR and between 7ae1dc7 and 984f7e2.

⛔ Files ignored due to path filters (1)
  • backend/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (11)
  • backend/src/index.ts
  • backend/src/integration.test.ts
  • backend/src/middleware/requestLogger.test.ts
  • backend/src/services/eventHistory.test.ts
  • backend/src/services/eventHistory.ts
  • backend/src/services/streamStore.reconcile.test.ts
  • backend/src/services/streamStore.test.ts
  • backend/src/services/streamStore.ts
  • backend/src/services/streamStore.updateStartAt.test.ts
  • backend/src/swagger.ts
  • backend/src/validation/schemas.ts
✨ 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.

@drips-wave

drips-wave Bot commented Jun 28, 2026

Copy link
Copy Markdown

@Shadow-MMN Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@ritik4ever ritik4ever merged commit 5a8ec91 into ritik4ever:main Jun 30, 2026
4 of 7 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.

Add GET /api/events/global pagination and filtering

2 participants