studio icon indicating copy to clipboard operation
studio copied to clipboard

[feature request] Re-run query on browser tab change

Open valtism opened this issue 2 years ago • 0 comments

Bug description

When switching within Prisma studio, the query on that tab is re-run. When the browser tab Prisma studio is in is switched to, the query does not re-run despite this being a usually desired behavior.

How to reproduce

  1. Have a tab open to a model
  2. Update this model using a program outside of Prisma studio, or an instance in another browser tab
  3. Switch back to the browser tab with Prisma studio
  4. The data does not refresh
  5. Switch Prisma studio tabs within the browser tab
  6. The data does refresh

Expected behavior

In both cases, the data should refresh.

This can be done using the Page Visibility API to trigger a re-run of the query.

Prisma information

v4.9.0

Environment & setup

  • OS: MacOS 13.1
  • Browser: Safari 16.2
  • Database: PostgreSQL

Prisma logs

No response

valtism avatar Feb 11 '23 22:02 valtism