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

Restore database -> subscriptions page (using queries rather than subscriptions, and with pagination) #333

Open
Venryx opened this issue Jul 24, 2024 · 1 comment

Comments

@Venryx
Copy link
Collaborator

Venryx commented Jul 24, 2024

We had to move away from using subscriptions / live-queries, because the subscriptions table just has way too many rows. (it was causing the app-server to crash, with over 90,000 subscriptions for a user who imported lots of nodes and was thus auto-subscribed to them all)

@Venryx
Copy link
Collaborator Author

Venryx commented Aug 23, 2024

Task: Create a new graphql "subscriptions" query endpoint (leave the existing subscription endpoint unchanged).

Details:

  • It should have the following params:
    • limit: [integer] The size of the result-set that the caller is requesting
    • after: [string, or null] If provided, the result-set begins after the "subscription" entry with the given id (the "id" column in the "subscriptions" table), to be used for pagination.
  • It should sort the result-set, in descending order (ie. newest ones first), based on the "updatedAt" field.
  • The response structure should also contain a field saying how many entries were "skipped over" (due to the "after" param), in order to retrieve the response's result-set. (this is used to ensure the "page number" displayed in the UI remains accurate even if new subscriptions get added while the user is progressing through the pages)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Short-term (Alvinosh)
Development

No branches or pull requests

1 participant