Opening file from non-refreshed folder view triggers false version conflict
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 659
- Forks
- 133
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 110
Description
Describe the bug
After editing a file locally and letting the sync complete, webversion still shows version conflict even though the versions are the same.
I edited the file and let the sync complete in the nextcloud files app:
Then I open the file in the web and it says there's a conflict between these two versions, but they both already have the latest edits:
To Reproduce
Steps to reproduce the behavior:
- Open a folder with an existing file in the web. Note file's last modified date
- Without reloading the webpage, edit the file locally via the desktop client and wait until sync is complete
- In the still open browser tab (folder view), open the file, without refreshing the tab. Note last modified date did not change
- Text app reports a version conflict, even though the edit done locally is already synced. Both versions shown are also the same
Expected behavior
The text app should fetch latest version from server without a conflict.
Screenshots
See bug description
Server details:
- Nextcloud version: 33.0.7 AIO docker
- PHP Version: 8.3.33
- Database: PostgreSQL 18.4 on x86_64-pc-linux-musl, compiled by gcc (Alpine 15.2.0) 15.2.0, 64-bit
Client details:
- OS: Windows
- Browser: Firefox/chrome/edge
- Browser version: 155.0.1 / 153.0.8010.37 / 152.0.4191.66
- Device: Desktop
- Nextcloud Files version: 3.17.0. / 34.0.3
Logs
Nextcloud log (data/nextcloud.log)
No visible log entries for this
Browser Console log
POST https://<DOMAIN>/apps/text/session/260486/sync 409 (Conflict)
(anonymous) @ sync.ts:76
_fetchSteps @ PollingBackend.ts:138
setInterval
connect @ PollingBackend.ts:109
startSync @ SyncService.ts:192
(anonymous) @ Editor.vue:535
Promise.then
onOpened @ Editor.vue:534
open @ SyncService.ts:181
await in open
constructor @ WebSocketPolyfill.ts:56
(anonymous) @ y-websocket.js:165
connect @ y-websocket.js:560
constructor @ y-websocket.js:444
(anonymous) @ SyncServiceProvider.js:41
initSession @ Editor.vue:448
created @ Editor.vue:425
mounted @ ViewerView.js:35
Promise.then
(anonymous) @ Viewer.vue:1294
Promise.then
beforeOpen @ Viewer.vue:610
openFileInfo @ Viewer.vue:706
openFile @ Viewer.vue:667
await in openFile
file @ Viewer.vue:452
Promise.then
open @ Viewer.js:320
execAction @ viewerAction.ts:80
execDefaultAction @ FileEntryMixin.ts:329
click @ FileEntry.vue:5
PollingBackend.ts:208 [ERROR] text: Conflict during file save, please resolve
{app: 'text', uid: '<UID>', level: 2}
_handleError @ PollingBackend.ts:208
Promise.then
_fetchSteps @ PollingBackend.ts:140
setInterval
connect @ PollingBackend.ts:109
startSync @ SyncService.ts:192
(anonymous) @ Editor.vue:535
Promise.then
onOpened @ Editor.vue:534
open @ SyncService.ts:181
await in open
constructor @ WebSocketPolyfill.ts:56
(anonymous) @ y-websocket.js:165
connect @ y-websocket.js:560
constructor @ y-websocket.js:444
(anonymous) @ SyncServiceProvider.js:41
initSession @ Editor.vue:448
created @ Editor.vue:425
mounted @ ViewerView.js:35
Promise.then
(anonymous) @ Viewer.vue:1294
Promise.then
beforeOpen @ Viewer.vue:610
openFileInfo @ Viewer.vue:706
openFile @ Viewer.vue:667
await in openFile
file @ Viewer.vue:452
Promise.then
open @ Viewer.js:320
execAction @ viewerAction.ts:80
execDefaultAction @ FileEntryMixin.ts:329
click @ FileEntry.vue:5
</details>
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the stale-folder workflow first, then trace the conflict from sync.ts and PollingBackend.ts through SyncService.ts and Editor.vue. Compare the file metadata used when opening the file with the server version returned during session sync. Done means the latest synced file opens from an unrefreshed folder without a false conflict.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 72/100