Skip to content

feat: add pagination to alerts and messages endpoints #1186

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

Closed
wants to merge 9 commits into from
Closed

Conversation

yrobla
Copy link
Contributor

@yrobla yrobla commented Mar 3, 2025

Modify the API to add pagination to those endpoints, to be able to render faster in the browser

Closes: #1020

@yrobla yrobla marked this pull request as draft March 3, 2025 10:29
Modify the API to add pagination to those endpoints, to be able
to render faster in the browser

Closes: #1020
@yrobla yrobla marked this pull request as ready for review March 3, 2025 16:00
peppescg
peppescg previously approved these changes Mar 3, 2025
Copy link
Contributor

@peppescg peppescg left a comment

Choose a reason for hiding this comment

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

LGTM 🚢

@alex-mcgovern
Copy link
Contributor

Copying this from Slack, so it doesn't get buried in discussion.

In early testing, we all saw crashed in the frontend — our Table implementation expects that chat_id on each object in the list of messages is unique — I am seeing some duplication in the response, e.g.

curl -s "http://localhost:8989/api/v1/workspaces/default/messages?page=1&page_size=50" | jq -r '.data | map(.chat_id)'
[
  "5c7d8bc9-716d-4106-aafc-890564cb212f", # dup #1
  "cf50f1e5-4064-42e5-bf26-15249dc78e46",
  "0fdd2a27-821a-427f-8bf6-cca39bfde838",
  "5ac437ff-6b1c-4aa4-b276-d43bce33f28e",
  "aa85b6a5-423a-4cd0-a27f-51088b5fe30c",
  "aadeadbb-43e0-4c20-9565-f0e5599596c7", # dup #2
  "00916b98-a3d3-424d-8e1f-d24da8c51afc",
  "3fae75e6-e32b-4d24-9856-f0b0cc88785e",
  "5c7d8bc9-716d-4106-aafc-890564cb212f", # dup #1
  "f397d262-07f6-4724-ac94-f0d45a09eb01",
  "9aa71a60-ab7f-4d76-b9a3-13ec25d65661",
  "aadeadbb-43e0-4c20-9565-f0e5599596c7", # dup #2
  "131a028d-9e00-4565-8796-40cef7cd3b83",
  "88a40a5f-dd98-46eb-bf53-7422853629c0"
]

* feat: filter messages by ID

* lint fix

* fix: use `.bindparams` for `filter_by_ids`
@yrobla
Copy link
Contributor Author

yrobla commented Mar 5, 2025

closed in favor of @alex-mcgovern PR

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 pagination to endpoints that read entire tables (alerts/messages)
3 participants