lost changes

I have just lost the changes I did to a private notebook. It was open in two windows and the old version was showing " Oops, unable to connect. Try reloading? ". The newer, I’m not sure. When I reloaded both pages, the newer version was gone :astonished:

Observable doesn’t have it either, so I guess it never went to the server?

The code I lost doesn’t matter, but it was more than a few changes in several cells.

Sorry for the trouble.

The “unable to connect” message means your browser isn’t connected to the server, and so changes are not being saved. If you continue editing, you should see another warning at the bottom of the window indicating that you have unsaved changes.

When you have unsaved changes, we persist changes in localStorage so they can be applied when you reconnect. However, if you are disconnected from the server, each window functions independently; so if you edit in both windows while not being connected, one of the windows will “win”, overwriting the changes from the other window. In other words, we don’t synchronize changes across tabs if you’re not connected to the server. (Though, now that I’ve discovered broadcast channels, it seems it would be possible.)

Is there something I can do next time I see them to try and understand why I’m “unable to connect”? I have these messages so often that I’ve learned (wrongly) to ignore them.

Yes, click the “reload” button on the message.

Unless there’s a network issue, usually the reason this message occurs is that your cookie has expired. If something in your browser is causing those cookies to expire more frequently than usual, that might explain why it’s occurring more often than expected.

It might be possible for us to handle this more gracefully (automatically), also.

3 Likes

I’m having a similar issue in Chrome tonight. The top of my page says " Oops, unable to connect.Try reloading?". The bottom of my page says “You have 30 unsaved changes, which will be saved when the server reconnects.”. Other than these two error messages, the page behaves fine.

Without doing anything on the page showing the error messages, I reopened the same workbook in another tab of my browser and it loaded with all of the most recent changes included so it looks like the original page ultimately synced with the server successfully, but just failed to clear the error notifications. Even after opening it successfully in the new tab, the original tab still had the error messages.

One possibly significant issue is that I worked on the page for several hours yesterday with no problem, then left the tab open and the PC idle for over 12 hours before I started to work on it again. I only started to notice these error messages after making some edits after leaving the tab idle for so long. Any chance that might be related? Not a big deal for me since no work was lost, but I thought I’d mention it anyway.

Similar issue here with firefox and a notebook that was (and still is) in limbo, with no URL (it’s still /new in the address bar and doesn’t appear in my account).

“Fork this notebook to save” seems to indicate that my page has lost track of its ownership (?).

There is an error in the console, indicating that line 4 of the developed code has failed in some way.

(to be clear: 2:49 became 4 when I clicked on pretty-print {})

(I moved some replies from the other thread here, as that thread has to do with the worker iframe hanging, as when the code goes into an infinite loop, or you have a tab open with a debugger paused.)

The 403 error suggests that this is an authentication problem, as with the other “Oops unable to connect” messages.

Fil, is there something that is causing your cookies to expire (more frequently than expected) in your browser? For example, are you manually clearing your cookies, or do you have an extension or browser setting that is automatically flushing cookies?

If you clear cookies but still have Observable open (say in a background tab), that would lead to the “Oops unable to connect” message when you return to the tab without reloading. Whenever your cookies are cleared, you’ll have to reload each open Observable tab before the tab will allow you to perform any authenticated action.

1 Like

I have the following extensions:

Bouton Enregistrer Pinterest
CSS Peeper
Google Docs hors connexion
OneTab
Sourcegraph
uBlock Origin
WebGL Inspector

Note that when this happens, I’m not disconnected from the other tabs open on Observable (I usually have a few of them :))

Maybe my internet connection is somewhat unstable. My VPN (ProtonVPN) often disconnects and reconnects, and I also often close the laptop and reopen it. But I have not yet seen a correlation between these events.

If your cookies are cleared, it wouldn’t typically look the other tabs were disconnected. Most operations would continue to function normally, but if you tried to edit a notebook, you’d see the “Oops unable to connect” message.

I believe that any tab that is open for more than 48 hours (without reloading, and only navigating within Observable) will experience the “Oops unable to connect” problem. We’re thinking about ways to fix this.

Please don’t post screenshots that include your cookie values, as these will allow others to impersonate you.

2 Likes

ok :slight_smile: (I had kept quite a few chars hidden for that purpose). Anyway they did not appear to be deleted.

This particular notebook was started last night and I realized it was still /new only this morning. Based on its history I seem to have opened that tab when you published https://observablehq.com/@mbostock/mareys-trains

Good news! We made some improvements to how we handle authentication cookies that should address these “unable to connect” errors. Please let us know if you see them again (when you otherwise have network connectivity).

3 Likes