Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: pass file id for direct editing and fail y.js provider setup if none was passed #4124

Merged
merged 2 commits into from
May 5, 2023

Conversation

juliusknorr
Copy link
Member

@juliusknorr juliusknorr commented May 5, 2023

📝 Summary

When setting up the WebsocketProvider we still used to create them even if no file id was passed. This is actually the case for direct editing trough android/iOS and would mean that if some browser states in the webview is still present it could mix up documents.

This is basically a follow up to b2186da

🏁 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
Copy link
Member Author

Note that the error behaviour is currently quite bad as when this happens the Editor.vue is just empty, will see if we can improve that as well.

@juliusknorr
Copy link
Member Author

/backport to stable26

@cypress
Copy link

cypress bot commented May 5, 2023

1 flaky tests on run #9681 ↗︎

0 142 1 0 Flakiness 1

Details:

fix: pass file id for direct editing and fail y.js provider setup if none was pa...
Project: Text Commit: f725c78b95
Status: Passed Duration: 03:40 💡
Started: May 5, 2023 3:39 PM Ended: May 5, 2023 3:42 PM
Flakiness  cypress/e2e/sync.spec.js • 1 flaky test

View Output Video

Test Artifacts
Sync > recovers from a lost connection Output Screenshots

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings.

Copy link
Member

@mejo- mejo- left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a minor comment.

And to be honest I don't fully understand the situation. So directediting sessions didn't pass a fileId before the change to DirectEditing.vue from this PR, which lead to WebsocketProvider instances with similar identifiers, which in turn could result in content from leftover sessions getting mixed into the new session. Is this roughly the scenario that this PR aims to fix?

src/services/SyncServiceProvider.js Show resolved Hide resolved
@juliusknorr
Copy link
Member Author

Yes with the addition that the mobile apps might not immediately cleanup the old web view which I've seen happening on iOS for example.

This could also happen on desktop when users use the desktop client option for direct editing.

@juliusknorr juliusknorr force-pushed the bugfix/noid/require-yjs-fileid branch from ff0249f to 812ff13 Compare May 5, 2023 10:13
Copy link
Member

@mejo- mejo- left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks ☺️

@mejo- mejo- force-pushed the bugfix/noid/require-yjs-fileid branch from 812ff13 to 23a46cd Compare May 5, 2023 15:29
@mejo-
Copy link
Member

mejo- commented May 5, 2023

/compile

Signed-off-by: nextcloud-command <[email protected]>
@mejo- mejo- merged commit f895fea into main May 5, 2023
@delete-merged-branch delete-merged-branch bot deleted the bugfix/noid/require-yjs-fileid branch May 5, 2023 15:43
@backportbot-nextcloud
Copy link

The backport to stable26 failed. Please do this backport manually.

# Switch to the target branch and update it
git checkout stable26
git pull origin/stable26

# Create the new backport branch
git checkout -b fix/foo-stable26

# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts. Resolve them.
git cherry-pick abc123

# Push the cherry pick commit to the remote repository and open a pull request
git push origin fix/foo-stable26

More info at https://docs.nextcloud.com/server/latest/developer_manual/getting_started/development_process.html#manual-backport

@mejo-
Copy link
Member

mejo- commented May 5, 2023

/backport 23a46cd to stable26

@max-nextcloud
Copy link
Collaborator

Great catch @juliushaertl and thanks for the quick review and backport @mejo- ! ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review bug Something isn't working high
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Text 3.7.2: Files mixed or emptied
4 participants