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

feat: optimized board queries #6931

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Commits on Sep 25, 2024

  1. Configuration menu
    Copy the full SHA
    845039e View commit details
    Browse the repository at this point in the history
  2. feat(app): optimize boards queries

    Use SQL instead of python to retrieve image count, asset count and board cover image.
    
    This reduces the number of SQL queries needed to list all boards. Previously, we did `1 + 2 * board_count` queries::
    - 1 query to get the list of board records
    - 1 query per board to get its total count
    - 1 query per board to get its cover image
    
    Then, on the frontend, we made two additional network requests to get each board's counts:
    - 1 request (== 1 SQL query) for image count
    - 1 request (== 1 SQL query) for asset count
    
    All of this information is now retrieved in a single SQL query, and provided via single network request.
    
    As part of this change, `BoardRecord` now includes `image_count`, `asset_count` and `cover_image_name`. This makes `BoardDTO` redundant, but removing it is a deeper change...
    psychedelicious committed Sep 25, 2024
    Configuration menu
    Copy the full SHA
    fcac493 View commit details
    Browse the repository at this point in the history
  3. chore(ui): typegen

    psychedelicious committed Sep 25, 2024
    Configuration menu
    Copy the full SHA
    d2f8181 View commit details
    Browse the repository at this point in the history
  4. feat(ui): use updated boards data

    - Update tooltips to use counts in the DTO
    - Remove unused `getBoardImagesTotal` and `getBoardAssetsTotal` queries, which were just abusing the list endpoint to get totals...
    - Remove extraneous optimistic update in invocation complete listener
    psychedelicious committed Sep 25, 2024
    Configuration menu
    Copy the full SHA
    9a36b3d View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    a091942 View commit details
    Browse the repository at this point in the history
  6. feat(ui): remove openDelay on board tooltip

    Now that the counts are already available and the tooltip does not make a network request, we can remove the delay (which was added to prevent network thrashing as you moved the mouse over the boards list).
    psychedelicious committed Sep 25, 2024
    Configuration menu
    Copy the full SHA
    1a6d80e View commit details
    Browse the repository at this point in the history