# lost changes

**URL:** <https://talk.observablehq.com/t/lost-changes/1715>\
**Category:** Uncategorized\
**Created:** [March 3, 2019, 4:06pm UTC](https://talk.observablehq.com/t/lost-changes/1715 "2019-03-03T16:06:48Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fil](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/fil/32/207_2.png) [@Fil](https://talk.observablehq.com/u/Fil)\
**Post date:** [March 3, 2019, 4:06pm UTC](https://talk.observablehq.com/t/lost-changes/1715/1 "2019-03-03T16:06:48Z")

</div>

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 😲

[Observable](https://observablehq.com/compare/aae5e16db6aa0fd2~1) 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.

---

<div class="post-metadata">

**Author:** ![mbostock](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/mbostock/32/9_2.png) [@mbostock](https://talk.observablehq.com/u/mbostock)\
**Post date:** [March 3, 2019, 5:21pm UTC](https://talk.observablehq.com/t/lost-changes/1715/2 "2019-03-03T17:21:50Z")

</div>

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](https://observablehq.com/@mbostock/broadcast-channel), it seems it would be possible.)

---

<div class="post-metadata">

**Author:** ![Fil](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/fil/32/207_2.png) [@Fil](https://talk.observablehq.com/u/Fil)\
**Post date:** [March 3, 2019, 5:30pm UTC](https://talk.observablehq.com/t/lost-changes/1715/3 "2019-03-03T17:30:32Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![mbostock](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/mbostock/32/9_2.png) [@mbostock](https://talk.observablehq.com/u/mbostock)\
**Post date:** [March 3, 2019, 6:33pm UTC](https://talk.observablehq.com/t/lost-changes/1715/4 "2019-03-03T18:33:53Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![david-hall](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/david-hall/32/848_2.png) [@david-hall](https://talk.observablehq.com/u/david-hall)\
**Post date:** [March 6, 2019, 5:54am UTC](https://talk.observablehq.com/t/lost-changes/1715/5 "2019-03-06T05:54:18Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Fil](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/fil/32/207_2.png) [@Fil](https://talk.observablehq.com/u/Fil)\
**Post date:** [March 6, 2019, 8:23am UTC](https://talk.observablehq.com/t/lost-changes/1715/6 "2019-03-06T08:23:34Z")

</div>

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 (?).

 ![55](https://canada1.discourse-cdn.com/flex030/uploads/observablehq/original/2X/e/e132b2179e28f67e6881994703f3db4510668f82.png)

---

<div class="post-metadata">

**Author:** ![Fil](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/fil/32/207_2.png) [@Fil](https://talk.observablehq.com/u/Fil)\
**Post date:** [March 6, 2019, 8:26am UTC](https://talk.observablehq.com/t/lost-changes/1715/7 "2019-03-06T08:26:35Z")

</div>

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

 ![34](https://canada1.discourse-cdn.com/flex030/uploads/observablehq/original/2X/3/33e30164163d8f77603edf1ad218d105e0d46af9.jpeg)

 ![25](https://canada1.discourse-cdn.com/flex030/uploads/observablehq/original/2X/8/88cbbf3c8379f028630f72cca88c9f59736ec700.png)

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

---

<div class="post-metadata">

**Author:** ![mbostock](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/mbostock/32/9_2.png) [@mbostock](https://talk.observablehq.com/u/mbostock)\
**Post date:** [March 6, 2019, 3:54pm UTC](https://talk.observablehq.com/t/lost-changes/1715/8 "2019-03-06T15:54:45Z")

</div>

(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.

---

<div class="post-metadata">

**Author:** ![Fil](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/fil/32/207_2.png) [@Fil](https://talk.observablehq.com/u/Fil)\
**Post date:** [March 6, 2019, 4:10pm UTC](https://talk.observablehq.com/t/lost-changes/1715/9 "2019-03-06T16:10:25Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![mbostock](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/mbostock/32/9_2.png) [@mbostock](https://talk.observablehq.com/u/mbostock)\
**Post date:** [March 6, 2019, 4:54pm UTC](https://talk.observablehq.com/t/lost-changes/1715/10 "2019-03-06T16:54:24Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![mbostock](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/mbostock/32/9_2.png) [@mbostock](https://talk.observablehq.com/u/mbostock)\
**Post date:** [March 6, 2019, 5:09pm UTC](https://talk.observablehq.com/t/lost-changes/1715/11 "2019-03-06T17:09:53Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![mbostock](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/mbostock/32/9_2.png) [@mbostock](https://talk.observablehq.com/u/mbostock)\
**Post date:** [March 6, 2019, 5:11pm UTC](https://talk.observablehq.com/t/lost-changes/1715/13 "2019-03-06T17:11:00Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Fil](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/fil/32/207_2.png) [@Fil](https://talk.observablehq.com/u/Fil)\
**Post date:** [March 6, 2019, 5:12pm UTC](https://talk.observablehq.com/t/lost-changes/1715/14 "2019-03-06T17:12:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Fil](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/fil/32/207_2.png) [@Fil](https://talk.observablehq.com/u/Fil)\
**Post date:** [March 6, 2019, 5:19pm UTC](https://talk.observablehq.com/t/lost-changes/1715/15 "2019-03-06T17:19:30Z")

</div>

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](https://observablehq.com/@mbostock/mareys-trains)

---

<div class="post-metadata">

**Author:** ![mbostock](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/mbostock/32/9_2.png) [@mbostock](https://talk.observablehq.com/u/mbostock)\
**Post date:** [March 6, 2019, 11:53pm UTC](https://talk.observablehq.com/t/lost-changes/1715/16 "2019-03-06T23:53:55Z")

</div>

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).
