Bug: Multiple filters cause 500 error - Turbo Frame ID collision #2354
Replies: 1 comment
-
|
Quick follow up on the filter bug in self-hosted SQLite: Root cause: This crashes with 500 on page load. First filter (single term) works fine. Fix:
Updated code: # app/models/search/record/sqlite.rb
scope :matching, ->(query, account_id) {
joins("INNER JOIN search_records_fts ON search_records_fts.rowid = #{table_name}.id")
.where("search_records_fts MATCH ?", query)
}
# app/helpers/pagination_helper.rb (relevant part)
pagination_params = params.permit(Filter::PERMITTED_PARAMS).to_h.merge(page: page_number, **url_params)
link_to label, url_for(pagination_params), ...Tested locally (SQLite): Compatibility note: |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Environment: Self-hosted with SQLite (latest main branch via Docker)
Issue:
Applying a second filter to cards causes a 500 "Content not found" error. First filter works fine, second filter crashes the app consistently.
Steps to Reproduce:
Stack Trace:
[bdba1dfa-a285-4ef1-8862-96ac548db6fb]
[bdba1dfa-a285-4ef1-8862-96ac548db6fb] app/views/cards/display/_previews.html.erb:1
[bdba1dfa-a285-4ef1-8862-96ac548db6fb] app/views/cards/index.html.erb:24
[bdba1dfa-a285-4ef1-8862-96ac548db6fb] app/helpers/pagination_helper.rb:43:in 'block (2 levels) in PaginationHelper#with_automatic_pagination'
[bdba1dfa-a285-4ef1-8862-96ac548db6fb] app/helpers/pagination_helper.rb:68:in 'Kernel#public_send'
[bdba1dfa-a285-4ef1-8862-96ac548db6fb] app/helpers/pagination_helper.rb:68:in 'PaginationHelper#pagination_list'
[bdba1dfa-a285-4ef1-8862-96ac548db6fb] app/helpers/pagination_helper.rb:41:in 'PaginationHelper#with_automatic_pagination'
Request: GET /0000001/cards?terms[]=open&terms[]=configure&sorted_by=latest&indexed_by=all
Status: 500
Root Cause:
pagination_frame_id_for()generates the same Turbo Frame ID regardless of filter params:cards_paginated_container-pagination-contents-1cards_paginated_container-pagination-contents-1(same ID, different content)Turbo sees identical frame IDs with different contexts and fails.
Note: This works correctly on fizzy.do (SaaS version), suggesting the issue might be related to SQLite queries.
Beta Was this translation helpful? Give feedback.
All reactions