silverbullet: Unexpected page conflict while editing page
TL;DR: Getting unexpected page conflict when editing page, with partial data loss.
Updates
Original issue was opened for Deno Deploy + Garage (S3 clone) setup. Which has been resolved(avoided) by running Deno directly on a server and use local disk for storage.
Similar issue seems to happen with different setup, see comments down below.
Issue description
While editing a page, app would suddenly detect file changed elsewhere then reloads or page conflicted which creates a conflict page.
There’s only 1 user from 1 browser tab.
Expected
No conflict or page change since there’s only 1 user.
Env info
- SB version: 0.3.5
- SB deployed on Deno Deploy
- SB storage using self-hosted Garage instance (S3 compatible)
- Browser: Firefox, Arc
- OS: MacOS 13.1
Screenshots
Logs
Server logs also available but less interesting than the browser one.
Partial browser output
Saving page meta/arch
Syncing file meta/arch.md
[sync] File changed on both ends, potential conflict meta/arch.md
[sync] Starting conflict resolution for meta/arch.md
[sync] File is markdown, using smart conflict resolution
[sync] Going to create conflicting copy meta/arch.conflicted.1689867793000.md
Saving page meta/arch
Syncing file meta/arch.md
[sync] File changed on primary, copying to secondary meta/arch.md
Saving page meta/arch
Syncing file meta/arch.md
[sync] File changed on primary, copying to secondary meta/arch.md
[sync] Fetching snapshot from primary
[sync] Fetching snapshot from secondary
[sync] File has changed on secondary, but not primary: copy from secondary to primary meta/arch.md
[sync] File has changed on secondary, but not primary: copy from secondary to primary meta/arch.conflicted.1689867793000.md
[sync] Sync complete, operations performed 2
Page changed elsewhere, reloading
Reloading page
Saving page meta/arch
Syncing file meta/arch.md
[sync] File changed on both ends, potential conflict meta/arch.md
[sync] Starting conflict resolution for meta/arch.md
[sync] File is markdown, using smart conflict resolution
[sync] Going to create conflicting copy meta/arch.conflicted.1689867952000.md
Saving page meta/arch
Syncing file meta/arch.md
[sync] File changed on primary, copying to secondary meta/arch.md
Saving page meta/arch
Syncing file meta/arch.md
[sync] File changed on primary, copying to secondary meta/arch.md
Saving page meta/arch
Syncing file meta/arch.md
[sync] File changed on primary, copying to secondary meta/arch.md
Saving page meta/arch
Syncing file meta/arch.md
[sync] File changed on primary, copying to secondary meta/arch.md
Saving page meta/arch
Syncing file meta/arch.md
[sync] File changed on primary, copying to secondary meta/arch.md
Saving page meta/arch
Syncing file meta/arch.md
[sync] File changed on primary, copying to secondary meta/arch.md
Saving page meta/arch
Syncing file meta/arch.md
[sync] File changed on primary, copying to secondary meta/arch.md
Saving page meta/arch
Syncing file meta/arch.md
[sync] File changed on primary, copying to secondary meta/arch.md
Saving page meta/arch
Syncing file meta/arch.md
[sync] File changed on primary, copying to secondary meta/arch.md
Saving page meta/arch
Syncing file meta/arch.md
[sync] File changed on primary, copying to secondary meta/arch.md
[sync] Fetching snapshot from primary
[sync] Fetching snapshot from secondary
[sync] File has changed on secondary, but not primary: copy from secondary to primary meta/arch.md
[sync] File has changed on secondary, but not primary: copy from secondary to primary meta/arch.conflicted.1689867952000.md
[sync] Sync complete, operations performed 2
Page changed elsewhere, reloading
Reloading page
Saving page meta/arch
Syncing file meta/arch.md
[sync] File changed on both ends, potential conflict meta/arch.md
[sync] Starting conflict resolution for meta/arch.md
[sync] File is markdown, using smart conflict resolution
[sync] Going to create conflicting copy meta/arch.conflicted.1689868015000.md
[sync] Fetching snapshot from primary
[sync] Fetching snapshot from secondary
[sync] File has changed on secondary, but not primary: copy from secondary to primary meta/arch.md
[sync] File has changed on secondary, but not primary: copy from secondary to primary meta/arch.conflicted.1689868015000.md
[sync] Sync complete, operations performed 2
Page changed elsewhere, reloading
Reloading page
Saving page meta/arch
Syncing file meta/arch.md
[sync] File changed on both ends, potential conflict meta/arch.md
[sync] Starting conflict resolution for meta/arch.md
[sync] File is markdown, using smart conflict resolution
[sync] Going to create conflicting copy meta/arch.conflicted.1689868039000.md
Saving page meta/arch
Syncing file meta/arch.md
[sync] File changed on primary, copying to secondary meta/arch.md
[sync] Fetching snapshot from primary
[sync] Fetching snapshot from secondary
[sync] File has changed on secondary, but not primary: copy from secondary to primary meta/arch.md
[sync] File has changed on secondary, but not primary: copy from secondary to primary meta/arch.conflicted.1689868039000.md
[sync] Sync complete, operations performed 2
Page changed elsewhere, reloading
Reloading page
Saving page meta/arch
Syncing file meta/arch.md
[sync] File changed on both ends, potential conflict meta/arch.md
[sync] Starting conflict resolution for meta/arch.md
[sync] File is markdown, using smart conflict resolution
[sync] Going to create conflicting copy meta/arch.conflicted.1689868055000.md
Saving page meta/arch
Syncing file meta/arch.md
[sync] File changed on primary, copying to secondary meta/arch.md
Saving page meta/arch
Syncing file meta/arch.md
[sync] File changed on primary, copying to secondary meta/arch.md
Saving page meta/arch
Syncing file meta/arch.md
[sync] File changed on primary, copying to secondary meta/arch.md
Saving page meta/arch
Syncing file meta/arch.md
[sync] File changed on primary, copying to secondary meta/arch.md
Saving page meta/arch
Syncing file meta/arch.md
[sync] File changed on primary, copying to secondary meta/arch.md
Saving page meta/arch
Syncing file meta/arch.md
[sync] File changed on primary, copying to secondary meta/arch.md
Saving page meta/arch
Syncing file meta/arch.md
[sync] File changed on primary, copying to secondary meta/arch.md
Saving page meta/arch
Syncing file meta/arch.md
[sync] File changed on primary, copying to secondary meta/arch.md
Saving page meta/arch
Syncing file meta/arch.md
[sync] File changed on primary, copying to secondary meta/arch.md
Saving page meta/arch
Syncing file meta/arch.md
[sync] File changed on primary, copying to secondary meta/arch.md
Saving page meta/arch
Syncing file meta/arch.md
[sync] File changed on primary, copying to secondary meta/arch.md
Saving page meta/arch
Syncing file meta/arch.md
[sync] File changed on primary, copying to secondary meta/arch.md
mini_editor.tsx:70 Creating editor view
[sync] Fetching snapshot from primary
[sync] Fetching snapshot from secondary
[sync] File has changed on secondary, but not primary: copy from secondary to primary meta/arch.md
[sync] File has changed on secondary, but not primary: copy from secondary to primary meta/arch.conflicted.1689868055000.md
[sync] Sync complete, operations performed 2
Page changed elsewhere, reloading
Reloading page
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 21 (2 by maintainers)
Commits related to this issue
- Attempt to address #479 — committed to silverbulletmd/silverbullet by zefhemel 4 months ago
Ok, I have implemented various attempts at fixes for this and I’m fairly hopeful that what I have now should be ok. If you could try a current edge build and see if this happens? https://community.silverbullet.md/t/living-on-the-edge-builds/27
I just spent the last 15 minutes typing and adding everything I could think of (templates, code blocks, tasks, etc.) …and absolutely no issues!! 🥳 I also kept a second tab open and watched that tab correctly reload itself whenever I made changes in the other.
This is amazing! I can’t speak for everyone else in this thread, but I think all of my issues have been resolved 😊 Thank you so much for your hard work, Zef!
I’ve been following this thread because I’ve been having this problem myself. Anecdotally the latest edge build is significantly better. This was happening very consistently and regularly for me, and now I’m not able to trigger the issue at all. So whatever you did seems to have worked for me. Thank you!!
Unfortunately, this did not fix the issue for me 😔 I’ve been getting the “Page changed elsewhere, reloading” error pretty frequently/consistently when typing, and switching to the edge version did not solve the issue nor reduce its frequency. I’ve included as much info as I could below:
My setup
edgetag) on DebianSETTINGS.md
PLUGS.md
Full Firefox console logs
I’m running into the “Page changed elsewhere, and that is going to reload” frequently on a Synology DS720+, DS224+ and a Raspberry Pi with a SSD attached. I have a reverse proxy configuration on the Synology that points to any of the units and wondering if that would have any role to play… browser used is MS Edge.
I just set up silverbullet and experienced this same behavior. It was happening quite often for me and I was able to reproduce it with Chrome dev tools open. I think the trick is that a page save is taking a very long time (in my case 11.6 seconds). While that request is in-flight,
index.jsonis also requested. That returns fast (76ms) and it appears the server’s response contains the updated timestamp, even though the PUT request is still pending. My guess is that the client is not accounting for the in-flight page save when it sees the updated timestamp inindex.json, gets confused, concludes it’s a conflict, and thus reloads the page.FWIW, I suspect my file-system (and not silverbullet) is at fault for the slow disk write.