Skip to content

Proposals listing caching has broken the listing and searching under Rails 5.1 default configurations #7513

@ahukkanen

Description

@ahukkanen

Describe the bug
When ordering the proposals with the "recent" ordering, the order seems broken (see the screenshot or go to see the issue at Metadecidim).

There are two separate issues regarding this that are most likely technically related:

  1. The order is incorrect, e.g. proposals from February and November 2019 comes 4th, 5th and 6th in the results and after them the next result seems correct (February 2021)
  2. The result listing produces duplicate records (see the exclamation marks in the attached screenshot)

There is also lots of other issues related to this. Basically there are collisions with the cache keys of the proposal cards (see comments below).

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://meta.decidim.org/processes/roadmap/f/122/proposals?order=recent
  2. (Alternatively, go without the "order" parameter and change the order yourself from the dropdown)
  3. Wait for the page to load
  4. See incorrect ordering and possible duplicates in the results

Expected behavior
I would expect the proposals to come ordered by their created_at dates when I change proposal ordering to "Recent".

Screenshots
metadecidim-proposals-recent-order

Stacktrace
No stacktrace, the issue is most likely with the filtering or the base query used to fetch the records.

EDIT: The issue is related to caching, see comments below.

Extra data (please complete the following information):

  • Device: Laptop
  • Device OS: Ubuntu 20.04
  • Browser: Chrome
  • Decidim Version: 0.24.0.rc1
  • Decidim installation: MetaDecidim

Additional context
Possibly incorrect joins in the query causing the results to get the created_at date from some other record and causing the results to produce duplicates?

Did not dig deeper, just seen similar issues in the past caused by incorrect joins.

EDIT: The issue is related to caching, see comments below.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions