Online mode: cannot come back from connection loss

Hello,

First off, thanks for Silverbullet! I’ve tried quite a few note taking app and always struggled with several things (mainly weird querying language, if any, and file syncing) and this seems to be the best solution for me!

Now my issue…

I’m using the online mode with a VM on my server only exposed via a VPN.
The problem I have is that when I reboot my laptop, sometimes I don’t put up the VPN before starting my browser.

Then I am welcomed by a completely blank page on the SilverBullet tab (the top banner is there, showing only the icons) and in no way can I refresh the page to get it back, the icons don’t do anything, only switching to the sync mode gives me something, but I loose the backlinks (?).

I see an error in the console but I don’t know if it’s relevant: SyntaxError: Unexpected token '<', "<!DOCTYPE "... is not valid JSON

Usually when I try to access one of my internal services from outside without the VPN up, it brings me to my external website. But a refresh or two after bringing up the VPN and I am good to go.

Last time I had this issue, I had to clear the cache for the domain, which resulted in me having to log back in ALL my personal apps (about 10) as they all share the same domain. So I’d like to avoid that :wink:

I had this issue with Firefox and a Chromium-based browser (Thorium).

Any idea? Did I do something wrong?

I guess the error is caused because the service worker is trying to get data from the server but it is only getting your external website (?), which probably servers html (?) on paths, where the server expects json. So this is probably to be expected. The service worker is also the reason why you can’t get to your external website as it’s trying to serve you silverbullet.
Normally tho if your silverbullet server comes available again it should just load up, without having to interfere + For me, if silverbullet is offline and I’m in online mode, I don’t even see a top bar.
I don’t really see a scenario, where silverbullet just locks up like that. Or is your problem just that you don’t get to your external website?

Tbh I’m unsure why the service worker is even needed for online mode.

Is there any way I could restart the service worker manually?

Yes, it more than probably points to the external website servicing an HTML page.

Just for info, on the network level, I have a “split DNS” where, if I’m in my LAN (including VPN connections), it points to a local address, if I’m not, the URL will resolve to my external IP. That’s why it gets confused.

But closing the tab does not solve the issue. If I open the URL in incognito mode, then it works.

So there is some sort of caching in the browser, and I get that it may be more of a browser issue than a Silverbullet one, but if I could find a way to reload the worked, without having to delete the cache, that would be great!

I found a workaround!

In the Chromium developer tools (probably the same in Firefox), there is a checkbox that says “Disable cache” on the network tab.
I could do a reload and the website is now back.

However, if there was a way to manage this in a different way, that’d be great, but now that I have a workaround, not too much of a big deal :slightly_smiling_face: