No error message shown when clearing reading history fails

Description

When destroying the readings in the clear action, the readings_controller attempts to handle any possible errors by rescuing them. However, this is broken in a few ways. Instead of destroy, destroy! should be used so that an error is thrown when deletion fails. The error message should be shown to users as a flash error by using @errors to set flash[:error]. Ideally the error message should also be internationalized.

Testing

Automated testing only. The error message can be tested with rspec by stubbing destroy! to raise ActiveRecord::RecordNotDestroyed.

Activity

Show:

Details

Assignee

Reporter

Roadmap

Reading History

Priority

Affects versions

Components

BackEnd

Difficulty

Milestone

Sentry

Created March 26, 2025 at 9:03 PM
Updated 2 days ago