I’m on v2 via Docker — I use it as a PWA on 4 separate devices currently (through cloudflared connected to a home server). When I load SB on a device, its local copy needs to be updated but short of a full refresh (which I sometimes have to do 2-3x b/c the browser might cache it?) or a time-consuming “full re-index”, I can’t seem to reliably force the PWA to “phone home” for updates.
Not a version upgrade issue (at least I don’t think) — it’s that the files in my space don’t reliably sync when I open up the PWA on a device after having made edits on the PWA on another device.
i.e. I’ll edit something on my phone while I’m out and about, come home and want to continue on my desktop and need to do some weird refresh tricks before I see the changes I made while on my phone.
That really shouldn’t be the case. Are you sure the sync doesn’t just take a while to kick in? Try to wait even up to a minute to see if it doesn’t happen after a while. Of course that would be to long, but at least indicate if something is really broken.
I definitely just watched this not work. I wrote out some major changes from the PWA on my phone last night. Loaded the PWA on my computer just now and despite waiting several minutes (because I got a phone call), I didn’t see the changes from the previous night reflected until I force refreshed the entire client.
Two things:
If this is not expected behavior, what log information can I dig up to show what’s happening?
To some degree, I’m comfortable with this behavior if there were a quick command I could add in the command palette or as a button to force a syncing. Does one exist?
Note that web apps on phones are only active when the browser is in the foreground, so you receiving a call would pause any sync that may happen. So you being on a phone call for several minutes “doesn’t count”
There are logs about sync happening in your browser’s Javascript console, but on a phone those are not easily accessible…
I can confirm this, and similar kinds of issues with sync, @zef this is how it behaves to me almost all the time.
I worked only on the server instance for last three days. Today I opened client on mobile and the top bar was yellow (not connected?). No sync indicator appeared. I reloaded the page (normal reload). The page refreshed and the top bar again was pale yellow after a second or so after the page was rendered…
So I did full refresh after a minute or two (holding the reload button in Firefox). Then I had to accept TLS exception (because the browser flushed that too) and was asked about beying redirected to the Silverbullet authentication page. I logged in.
Then the sync started after few moments. First the “Page changed elsewhere…” detected that index page had been changed (but it was not, I checked my Git logs). Cca 10s to 100% sync. Then again for a fraction of a second sync indicator apeared again and jumped directly to 100% (why?), then another very slow full sync (cca 30s) appeared. And then the red indicator progressed to 100% indexing everything (there was plethora of new Lua stuff added in the last three days apart from some notes).
After these weird syncing/indexing rounds the page stayed with widgets unrendered (my index has many Lua in it) for some time, cca 20s. Then widgets etc. rendered but still showing old, previous content for another few seconds. Then, finally, everything refreshed and I had synced client.
Now, the very same happens everytime I close Silverbullet tab on mobile and open it again, or close the browser and open it again. Every time I have to proceed with this fairly similar process, as described. I can reproduce it. It simply happens everytime I open browser or new instance of Silverbullet client.
I hope this description helps to fix the long-standing syncing issues.
UPDATE
I also realized now that if the browser goes background and then foreground Silverbullet starts to indicate it cannot connect. In contrary to the issues described above normal (soft) reload of the page causes it to start working again. But if you close the browser and open it again, soft reload does not help at all and the full circle must be done, as described, starting with hard page reload etc…
I completely rely on FF (I know it’s not good) so - no, I don’t have any browser even installed. I think there is some version for developers but never tried it. I will look into it at weekend…
But, to be honest, I have misc. issues with syncing in v1 too (still not completely migrated because of no spare time to), and they seem to be similar in v2. The most strange thing is that the tab with Silverbullet evidently cannot connect until it is reloaded. What can be causing this?