Project

General

Profile

Actions

Patch #39110

closed

Replacing request_store with ActiveSupport::CurrentAttributes

Added by Takashi Kato about 1 year ago. Updated 12 months ago.

Status:
Closed
Priority:
Normal
Category:
Code cleanup/refactoring
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:

Description

Redmine utilizes the request_store gem to maintain a record of currently logged-in users.
However, Rails itself offers an additional feature called ActiveSupport::CurrentAttributes leveraging this module, we can eliminate the reliance on request_store.

ActiveSupport::CurrentAttributes provides equivalent functionality to request_store, but its value is reset when an ActiveJob is executed. To address this, a callback has been introduced to preserve the value when ActiveJob is employed.
I'm sharing this post because I'm currently running Redmine on a new Rails version, and after applying the following pull request, "test/integration/sudo_mode_test.rb" began to fail in multiple instances.

Link to the pull request: https://github.com/rails/rails/pull/47092


Files


Related issues

Related to Redmine - Feature #36320: Migrate to Rails 7.2ClosedMarius BĂLTEANU

Actions
Actions

Also available in: Atom PDF