Skip to content

Inconsistency using the browser back after using turbo_stream.remove #89

@dailson-igo

Description

@dailson-igo

Good morning, everyone!!!

When I delete a record, turbo_stream.remove(@customer) delete the row from the table displayed by the index action of the customers_controller. After that, if I go to the show action of a record and click on the browser back, the table is displayed without the removal that was done with turbo_stream.remove.

This error only occurs when I am using Hotwire Spark.

  • Rails 8.0.1 application starting in development
  • Run bin/rails server --help for more startup options
    Puma starting in single mode...
  • Puma version: 6.6.0 ("Return to Forever")
  • Ruby version: ruby 3.4.1 (2024-12-25 revision 48d4efcb85) +YJIT +PRISM [x86_64-linux]

Steps:

  1. git clone --branch v0.1.0 --depth 1 https://github.com/dailson-igo/css-zero-store.git
  2. bundle install && bin/rails db:setup && bin/dev
  3. Open Customer index action
  4. Remove one or more records
  5. Note that the table rows are removed after deleting the records
  6. Click in the eye to open show action from same record
  7. Back using browser button
  8. The records that were previously removed using turbo_stream.remove from the table present in the index action will appear again after clicking on the browser back button
  9. If you disable the hotwire-spark gem, the error disappears
WhatsApp.Video.2025-02-20.at.08.12.09.mp4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions