Skip to content

bfcache not used because WebSocket connection is not closed #6456

@dumdum7

Description

@dumdum7

Describe the bug

When navigating to a different page and then going back, page should not refresh, and scroll position should restore. It currently doesn't due to bfcache not being used because of an open WebSocket connection. See https://web.dev/articles/bfcache#close-open-connections

I think fix should be fairly simple: call wsClient.dispose() on pagehide event, and create a new client on pageshow event.

Steps to reproduce

  1. Go to Stash
  2. Scroll down
  3. Go to a different page, e.g. google.com
  4. Go back with browser button
  5. Page is refreshed, and scroll position is reset

Expected behaviour

Page should be retrieved from bfcache.

Screenshots or additional context

No response

Stash version

v0.30.1

Device details

Chrome on Windows

Relevant log output

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug reportBug reports that are not yet verified

    Type

    No type

    Projects

    Status

    To triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions