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

[FIX] Fix the filtered_programs_for_user call #4724

Merged
merged 3 commits into from
Nov 8, 2023

Commits on Nov 8, 2023

  1. [FIX] Revert the filtered_programs_for_user change

    In #4644, the call signature of `filtered_programs_for_user` was
    changed, and the call `public_programs_for_user` removed.
    
    Unfortunately, there is no index on the pair `(username, public)`.
    Instead, we have indexes on `(username)` and on `(public, date)`.
    
    The first is used to retrieve all programs by a single user, the second
    is used to retrieve all public programs (for the "Explore" page). To get
    the public programs for a single user, instead what we do is retrieve
    all programs for a single user, and filter them down in Python.
    
    Because of a bug, trying to retrieve programs by `{ "username": "henk",
    "public": 1 }` uses the `(public, date)` index. However, the database
    layerbut does not detect that the field `date` is missing and that the
    field `username` is unnecessarily passed. The query incorrectly succeeds
    on the local database emulation layer, and when passed to an actual
    DynamoDB database the server returns an error.
    
    This currently breaks the profile page, as well as some other pages
    probably.
    
    Revert the changes from #4644 that lead to this problem, restoring
    the `public_programs_for_user` method and undoing the change to
    `filtered_programs_for_user`.
    rix0rrr committed Nov 8, 2023
    Configuration menu
    Copy the full SHA
    ed756d2 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    1a353b7 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    e04e4bd View commit details
    Browse the repository at this point in the history