Turbo: Drupal messages are lost if Turbo does a full reload

Created on 1 October 2024, about 1 month ago

Problem/Motivation

Drupal messages are lost and not seen by the user if they get output in an HTML response to Turbo in which Turbo detects a tracked element mismatch and forces a full page reload. This occurs if an element is marked with the data-turbo-track="reload" attribute and its other attributes or content changes.

Steps to reproduce

Go to an admin form whose submit can cause such a change, like clearing the cache. Note the page reloads but the Drupal message won't be present.

Proposed resolution

This would ideally be done in the back-end if possible to re-emit messages a second time if we can detect that Turbo forced a full load; however, it's unclear if we can reliably detect this and how. One possibility might be to set a cookie during the turbo:reload event, but that will only work if the reload occurs after the event handler is triggered.

Remaining tasks

See above.

User interface changes

Messages should display reliably.

API changes

None.

Data model changes

None.

🐛 Bug report
Status

Active

Version

2.0

Component

User interface

Created by

🇨🇦Canada ambient.impact Toronto

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024