feat: Use notify push for sync messages during editing
Signed-off-by: Julius Hรคrtl [email protected]
๐ Summary
- Resolves: #1805
This is a first PoC to make use of notify_push for syncing steps back to other editors instead of regular polling. We still poll every 30 seconds as a fallback and to ensure that the autosave requests are still triggered until https://github.com/nextcloud/text/pull/4424 is there (even with that some fallback sync might still be worth).
Can be manually enabled for now with
occ config:app:set text notify_push --type boolean --value=1
๐ง TODO
- [x] More manual testing in different scenarios
- [x] Check what happens with the base doc changing externally (did we use the sync to detect the conflict?)
๐ Checklist
- [ ] Code is properly formatted (
npm run lint/npm run stylelint/composer run cs:check) - [ ] Sign-off message is added to all commits
- [ ] Tests (unit, integration and/or end-to-end) passing and the changes are covered with tests
- [ ] Documentation (README or documentation) has been updated or is not required
1 flaky tests on run #11336 โ๏ธ
Details:
| feat: Use notify push for sync messages during editing | |||
| Project: Text | Commit: 90c956236b |
||
| Status: Passed | Duration: 04:17 ๐ก | ||
| Started: Jul 27, 2023 6:27 PM | Ended: Jul 27, 2023 6:32 PM | ||
ย cypress/e2e/nodes/Links.spec.js โข 1 flaky test
| Test | Artifacts | |
|---|---|---|
| ... > Link website with selection |
Output
Screenshots
|
|
This comment has been generated by cypress-bot as a result of this project's GitHub integration settings.
Thanks a lot for looking into this. I'm really curious to play with it. :heart_eyes:
We still poll every 30 seconds as a fallback and to ensure that the autosave requests are still triggered until https://github.com/nextcloud/text/pull/4424 is there (even with that some fallback sync might still be worth).
Just one remark. Autosave is independent from the polling backend these days. It's triggered by https://github.com/nextcloud/text/blob/14d29b1bd33a73a8e9309310b7b3550b2e44f7d4/src/services/SyncService.js#L91
Never the less I agree that having a fallback for a start might still be worthwhile.
This is good from my side. I did quite some testing locally with different scenarios of browsers going offline, coming back, overwriting the file externally and it seems to be quite smooth.
Nevertheless I added a feature flag to opt-in for now, so we can maybe testrun this a bit more on a daily instance.
- [x] Need to do an extra check for public share links (as I haven't yet)