Open nhogle opened 1 week ago
@nhogle Will have a look at this. Though one question - The web app currently has a bug (#563) where it doesn't work in offline state. How are you able to use the web app without Internet? Also, assuming the web app was working in offline state, you don't need to export and logout to be able to work offline. Even in logged in state you can simply work on your creations, without Internet. Your changes sync to the database next time when you come online.
@chinchang : You're right, I just went back to check, and it looks like I can't run the creations while offline. I was, however, able to import my previously-exported creations (while logged out), and make changes to the code. That was when I discovered that I couldn't save changes. My internet later came back online, so I was able to run the creation again (but still unable to save) so I didn't realize that the offline state was preventing running the creation.
As for saving while offline (and logged in): I see that this works if you do the following:
However, if you make multiple sets of changes while offline, and you try saving between those changes, then we run into problems:
I didn't test this while logged out. Does this help?
Update: I created issue #575 to document the crash issue that I'm noticing when I tried loading the publicly-shared creation in a fresh browser.
Open a creation while online and logged in. Go offline (disconnect wifi) Make some changes Click the "Save" button (I have my auto-save set to "off"). Save button is now disabled with a spinner. Go back online The save button is re-enanabled and the spinner goes away. (And presumably the creation is saved).
These steps you are noticing on your end seem different from the expected behaviour. In offline state, if you press save button, the creation should still save with a message - "Item saved locally. Will save to account when you are online".
Don't you see this message on saving in offline state?
Meta info
While I am logged out, if I import a creation that I had previously exported while logged in, then I cannot save changes to that creation (Save button is not visible).
Use case: I wanted to keep working and save changes to creations while logged out (e.g. I want to work offline because my Internet connection is spotty). So I exported my creations to JSON, then logged out. Now I can work offline and save creations to local storage instead of the cloud. The problem is, if I want to work on my previously-exported creation, then I can import that creation, but I cannot save changes to it. This is due to the
isNotMine
boolean which is declared here.It seems the purpose of the
isNotMine
flag is to prevent users from trying to save or share other users' public creations? I can think of a couple ways to fix this issue:createdBy
property when importing it, (or delete the property if not logged in?)isNotMine
and public sharing logic. If you open a public creation from a URL, shouldn't you be able to fork that creation and work on it within your own workspace? Actually now that I'm looking at this deeper, it appears the app completely breaks when opening a publicly-shared creation (e.g. in a different browser, or in incognito mode). Perhaps I should file that as a separate issue?