graphql-platform icon indicating copy to clipboard operation
graphql-platform copied to clipboard

[BCP] "Leave site" is displayed when closing BCP

Open PascalSenn opened this issue 3 years ago • 14 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Describe the bug

Instead of just closing the Tab. BCP displays the follwoing popup:

image

Steps to reproduce

  1. open eat.bananacakepop.com
  2. open a document
  3. type "foo"
  4. close the browser tab

Relevant log output

No response

Additional Context?

No response

Product

Banana Cake Pop

Version

1.0.4

PascalSenn avatar Sep 10 '22 15:09 PascalSenn

@PascalSenn The message is misleading, because might be that there is nothing to save. The message should state something like "Your are going to close the App.". Even this behaviour could be behind a user flag.

artola avatar Sep 10 '22 15:09 artola

@PascalSenn cannot reproduce

rstaib avatar Sep 10 '22 15:09 rstaib

@artola I guess there should be no message at all, as this is really annoying when you work on you server and every single time you have to press "leave" when you close a tab.

@rstaib happens in chrome based browsers. you have to have a unsaved change though. my bad

PascalSenn avatar Sep 10 '22 16:09 PascalSenn

@PascalSenn this is not a bug it's a feature

rstaib avatar Sep 10 '22 17:09 rstaib

@rstaib but you do not loose state when you close the tab right?

PascalSenn avatar Sep 10 '22 17:09 PascalSenn

@PascalSenn, of course, you can lose state as soon as a browser decides whether a certain indexeddb has to be cleaned up.

rstaib avatar Sep 10 '22 17:09 rstaib

Not at my PC at the moment, but it was happening every time that I built the project, which resulted in the tab being reloaded and being stuck with this message, sometimes duplicated.

I think it would be better to just auto-persist to local storage or something.

glen-84 avatar Sep 10 '22 17:09 glen-84

@glen-84 we're persisting tabs to indexeddb, but as I pointed out it's not guaranteed to be safe. that's why we nowadays sync to the cloud. As soon as you save a document and sync to the cloud your documents are safe 👍🏻

rstaib avatar Sep 10 '22 18:09 rstaib

@rstaib i mean this does not happen often. Personally i have never had this cleanup thing of the browser. I think this popup is more in the way than helpful.

PascalSenn avatar Sep 10 '22 18:09 PascalSenn

I find very helpful this feature, especially when the using try to navigate with the "go back" as is use in SPA, and just would leave the application, even losing changes. But, I would suggest to improve the wording of the message and add a flag in the user settings to disable it.

artola avatar Sep 10 '22 18:09 artola

I'm not signed in though. It should just auto-persist locally if you're not signed in. 🙂

I don't really expect the persistence to be 100% safe, these are just queries.

@artola With auto-persistence (debounced typing or whatever), 99.9% of the time the prompt will be unnecessary.

It completely breaks the development flow.

glen-84 avatar Sep 10 '22 18:09 glen-84

@glen-84 From my point of view, even if there nothing to sync, I would like to have this warning before leaving the app. For example, I do the same with Chrome and VSCode, just pressing Cmd+Q should ask before close. About these are just queries I have some colleagues that spent hundred of hours building their queries, they can not just lose them, therefore sync to the cloud is due.

artola avatar Sep 10 '22 18:09 artola

That makes no sense, if there's nothing to sync (no unsaved changes), then why do you need to be warned about closing something? It's a UX anti-pattern.

Also, VSC doesn't prompt me when I close it. Even with unsaved changes (they are still persisted to UI state).

I'm not sure why your colleagues are writing so many queries in the browser (reporting queries?), but that seems like an uncommon use case. Regardless, I'm not against prompting if there are unsynced changes – the changes should just be synched more often, especially locally (which can then cloud-sync if/when the browser is reopened).

I really appreciate the work that you guys do, but this feature is broken (at least when not signed in).

glen-84 avatar Sep 10 '22 18:09 glen-84

@glen-84 we'll show this message with the next update only when someone is signed in and has some unsaved changes in at least one tab. Still, be aware that the browser can clean up any local storage anytime. Meaning that your documents are not safe if not synced with the cloud. Apart from that, thanks for your feedback.

rstaib avatar Sep 11 '22 10:09 rstaib

The warning will be disabled for now in version 2.0.0, which will be released in the mid of next week.

rstaib avatar Sep 25 '22 19:09 rstaib