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

Update viewId in Writer after recover from idle #7807

Merged
merged 1 commit into from Dec 11, 2023

Conversation

eszkadev
Copy link
Contributor

There was a bug in Writer not allowing to successfully reconnect after idle state if we were not a first view in the initial document. Let's update view id even if document size wasn't changed. Added also additional error logging to be sure we never use -1 viewId which is a default "bad value" when we enter some unwanted state in the core.

Steps to reproduce:

  1. set per_document.idle_timeout_secs to something small, eg. 30, so sessions time out quickly,
  2. Open a document with 2 sessions (remember which one was loaded first - A, important!)
  3. wait for it to idle out in both sessions
  4. activate SECOND session (B) by click on the document area

Result:
in the browser console you can see an exception:
Exception TypeError: this.map._viewInfo[this.map._docLayer._viewId] is undefined emitting event viewinfo: [{"id":0,"userid":"2","username":"LocalUser#2","readonly":"0","color":411298}] cool.html:359:37

There was a bug in Writer not allowing to successfully reconnect
after idle state if we were not a first view in the initial document.
Let's update view id even if document size wasn't changed.
Added also additional error logging to be sure we never use -1 viewId which is
a default "bad value" when we enter some unwanted state in the core.

Steps to reproduce:
1. set per_document.idle_timeout_secs to something small, eg. 30, so sessions time out quickly,
2. Open a document with 2 sessions (remember which one was loaded first - A, important!)
3. wait for it to idle out in both sessions
4. activate SECOND session (B) by click on the document area

Result:
in the browser console you can see an exception:
Exception TypeError: this.map._viewInfo[this.map._docLayer._viewId] is undefined emitting event viewinfo: [{"id":0,"userid":"2","username":"LocalUser#2","readonly":"0","color":411298}] cool.html:359:37

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I23775230e169f61cb816b819f2dea56e293b20e1
Copy link
Contributor

@caolanm caolanm left a comment

Choose a reason for hiding this comment

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

makes a lot of sense to me

@caolanm caolanm merged commit 515f66e into master Dec 11, 2023
12 checks passed
@caolanm caolanm deleted the private/eszkadev/idle-viewid branch December 11, 2023 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants