Skip to content

Provide detail in DB statement timeout error for filters#8117

Merged
javierjulio merged 1 commit into
activeadmin:masterfrom
Vicentecorrea:debug/give-more-info-about-db-timeout-error-in-filters
Dec 1, 2023
Merged

Provide detail in DB statement timeout error for filters#8117
javierjulio merged 1 commit into
activeadmin:masterfrom
Vicentecorrea:debug/give-more-info-about-db-timeout-error-in-filters

Conversation

@Vicentecorrea

@Vicentecorrea Vicentecorrea commented Oct 22, 2023

Copy link
Copy Markdown
Contributor

Hello everyone! 👋

When a database timeout error occurs querying the values for a sidebar filter, the error message does not report that it is an error in the filters nor does it indicate the specific filter with the error, so I propose this change to give more information to the developer about the error so he can work on it.

Context: using a Rails application in which I use Active Admin, I accessed the view of a resource with many records and after a few seconds I got the error PG::QueryCanceled: ERROR: canceling statement due to statement timeout, but the error was not querying records for the table, it was querying values for a sidebar SelectInput filter.

@tagliala

Copy link
Copy Markdown
Contributor

Thanks for this PR. Any chance to add a spec to cover this use case?

@codecov

codecov Bot commented Oct 23, 2023

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (de2cc85) 99.04% compared to head (c7951a2) 99.04%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #8117   +/-   ##
=======================================
  Coverage   99.04%   99.04%           
=======================================
  Files         182      182           
  Lines        4721     4722    +1     
=======================================
+ Hits         4676     4677    +1     
  Misses         45       45           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Vicentecorrea Vicentecorrea force-pushed the debug/give-more-info-about-db-timeout-error-in-filters branch from 9e646d8 to 596e7c6 Compare October 26, 2023 04:26
@Vicentecorrea

Copy link
Copy Markdown
Contributor Author

@tagliala good idea. Spec ready, thank you!

Comment thread lib/active_admin/inputs/filters/select_input.rb Outdated
Comment thread spec/unit/filters/filter_form_builder_spec.rb Outdated
Comment thread spec/unit/filters/filter_form_builder_spec.rb Outdated
Comment thread spec/unit/filters/filter_form_builder_spec.rb Outdated
Comment thread spec/unit/filters/filter_form_builder_spec.rb Outdated
@Vicentecorrea Vicentecorrea force-pushed the debug/give-more-info-about-db-timeout-error-in-filters branch 2 times, most recently from 0b56391 to 9ab7883 Compare November 27, 2023 14:02
@javierjulio javierjulio force-pushed the debug/give-more-info-about-db-timeout-error-in-filters branch from 9ab7883 to 39eebb6 Compare November 27, 2023 15:40
@javierjulio javierjulio changed the title Give more info about db timeout error in filters Provide detail in DB statement timeout error for filters Dec 1, 2023
@javierjulio javierjulio self-assigned this Dec 1, 2023

@javierjulio javierjulio left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

When a database timeout error occurs querying the values for
a filter, the error message does not give the filter information
@javierjulio javierjulio force-pushed the debug/give-more-info-about-db-timeout-error-in-filters branch from 39eebb6 to c7951a2 Compare December 1, 2023 02:56
@javierjulio javierjulio merged commit 582fc72 into activeadmin:master Dec 1, 2023
mgrunberg pushed a commit to mgrunberg/activeadmin that referenced this pull request Dec 10, 2023
…error for filters (activeadmin#8117)

Give more info about db timeout error in filters

When a database timeout error occurs querying the values for
a filter, the error message does not give the filter information
mgrunberg added a commit that referenced this pull request Dec 11, 2023
…error for filters (#8117) (#8163)

Give more info about db timeout error in filters

When a database timeout error occurs querying the values for
a filter, the error message does not give the filter information

Co-authored-by: Vicente Correa <vcorrea@buk.cl>
faizaankhan pushed a commit to bugcrowd/activeadmin that referenced this pull request Dec 28, 2023
…error for filters (activeadmin#8117) (activeadmin#8163)

Give more info about db timeout error in filters

When a database timeout error occurs querying the values for
a filter, the error message does not give the filter information

Co-authored-by: Vicente Correa <vcorrea@buk.cl>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants