Active
Project:
Drupal core
Version:
main
Component:
system.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
20 Jul 2025 at 21:28 UTC
Updated:
24 Sep 2025 at 00:49 UTC
Jump to comment: Most recent
The changes for issue 3508299 have introduce a regression for a certain messages use case. I am developing a private module that uses middleware to add messages to pages when certain other criteria in the module are met. Unfortunately, when a redirect is involved in visiting a page, the message appears twice, despite the repeat flag being false. I used git bisect to narrow it down the the above listed change. Debugging showed that second request did not contain the message in the flashbag that had been added in the first request, resulting in it being added on both requests.
Note this doesn't happen when bigpipe is not installed.
Either fix or revert the change until a fix can be found.
Comments
Comment #2
bpietsch commentedComment #3
cilefen commentedCould we see enough of your code implementation to see if this is a bug or an API misunderstanding?
Comment #4
bpietsch commentedComment #5
bpietsch commentedComment #6
bpietsch commentedOK, One additional critical bit to reproduction is that you need to access session data in the middleware code in order to see the issue. That patch I've attached in comment #5 (3537044-3.patch) is a simple module that reproduces the issue. Install the module on the admin page (appears under development section), log-into the site and then visit any URL that redirects (such as "/user?check_logged_in=1"). This will reproduce in 11.2, but not 11.1.8 and also will not reproduce in 11.2 if session data is not accessed.
Please let me know if you need further details.
Comment #7
bpietsch commentedIn my case, the use of session is to access cached data that is expensive to retrieve. My use case is to display a warning to the logged in user based on this cached data on every page until they address the issue.
Comment #8
quietone commentedIf this problem was discovered on a version of Drupal that is not 11.x, add that information in the issue summary and leave the version at 11.x. In Drupal core changes are made on on 11.x (our main development branch) first, and are then back ported as needed according to the Core change policies. Also mentioned on the version section of the list of issue fields documentation. Thanks.
Comment #9
bpietsch commented@quietone, this is a regression between 11.1.8 and 11.2.0 (specifically, the changes for 3508299 caused this regression)
Comment #10
mstrelan commentedI can reproduce this on 11.x with the example module in #5. Updating steps to reproduce.