text icon indicating copy to clipboard operation
text copied to clipboard

feat: Use notify push for sync messages during editing

Open juliusknorr opened this issue 2 years ago โ€ข 4 comments

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

juliusknorr avatar Jul 26 '23 18:07 juliusknorr

1 flaky tests on run #11336 โ†—๏ธŽ

0 149 2 0 Flakiness 1

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
Flakinessย  cypress/e2e/nodes/Links.spec.js โ€ข 1 flaky test

View Output Video

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.

cypress[bot] avatar Jul 26 '23 18:07 cypress[bot]

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.

max-nextcloud avatar Jul 28 '23 05:07 max-nextcloud

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.

juliusknorr avatar Jun 13 '24 14:06 juliusknorr

  • [x] Need to do an extra check for public share links (as I haven't yet)

juliusknorr avatar Jun 25 '24 15:06 juliusknorr