Problem/Motivation

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.

Steps to reproduce

  • Install 11.x with standard profile
  • Log in to site
  • Apply patch from #5
  • Enable Test3537044
  • Visit the home page
  • Click the "My account" link

Note this doesn't happen when bigpipe is not installed.

Proposed resolution

Either fix or revert the change until a fix can be found.

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Comments

bpietsch created an issue. See original summary.

bpietsch’s picture

StatusFileSize
new2.82 KB
cilefen’s picture

Status: Active » Postponed (maintainer needs more info)
Issue tags: +Needs steps to reproduce

Could we see enough of your code implementation to see if this is a bug or an API misunderstanding?

bpietsch’s picture

Status: Postponed (maintainer needs more info) » Active
Issue tags: -Needs steps to reproduce
StatusFileSize
new0 bytes
bpietsch’s picture

StatusFileSize
new2.55 KB
bpietsch’s picture

OK, 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.

bpietsch’s picture

In 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.

quietone’s picture

Version: 11.2.x-dev » 11.x-dev

If 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.

bpietsch’s picture

@quietone, this is a regression between 11.1.8 and 11.2.0 (specifically, the changes for 3508299 caused this regression)

mstrelan’s picture

Issue summary: View changes

I can reproduce this on 11.x with the example module in #5. Updating steps to reproduce.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.