Skip to content

Conversation

@max-nextcloud
Copy link
Collaborator

Perform all computations / comparisons in milliseconds.

The collaborator disconnect timeout is in ms as are all intervals.
So we can directly subtract it from Date.now() - which also is in ms.
The only time that is not expressed in ms is the last contact timestamp.

See also #3741

🏁 Checklist

  • Code is properly formatted (npm run lint / npm run stylelint / composer run cs:check)
  • Sign-off message is added to all commits
  • Tests - this is a first take at a minimal fix. It's somewhat hard to test in the current state. Will look into refactoring later.
  • Documentation is not required

@max-nextcloud
Copy link
Collaborator Author

/compile

@max-nextcloud
Copy link
Collaborator Author

max-nextcloud commented Feb 6, 2023

Even though this improves the behavior of the PollingBackend by increasing the timeout to 5s right away it still alternates between 5sec. and 300ms (after every message received from the user themselves.)

Signed-off-by: nextcloud-command <[email protected]>
@cypress
Copy link

cypress bot commented Feb 6, 2023

1 flaky tests on run #8496 ↗︎

0 132 0 0 Flakiness 1

Details:

fix: collaborator disconnect timeout
Project: Text Commit: e929b49c72
Status: Passed Duration: 04:09 💡
Started: Feb 6, 2023 8:39 PM Ended: Feb 6, 2023 8:43 PM
Flakiness  cypress/e2e/share.spec.js • 1 flaky test

View Output Video

Test
Open test.md in viewer > Share a file with download disabled shows an error Screenshot

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

@juliusknorr juliusknorr merged commit ac91e93 into main Feb 7, 2023
@delete-merged-branch delete-merged-branch bot deleted the fix/collaborator-disconnect branch February 7, 2023 08:16
max-nextcloud added a commit that referenced this pull request Feb 7, 2023
The collaborator disconnect timeout is in ms as are all intervals.
So we can directly subtract it from `Date.now()` - which also is in ms.
The only time that is not expressed in ms is the last contact timestamp.

Backport of #3769

Signed-off-by: Max <[email protected]>
max-nextcloud added a commit that referenced this pull request Feb 7, 2023
The collaborator disconnect timeout is in ms as are all intervals.
So we can directly subtract it from `Date.now()` - which also is in ms.
The only time that is not expressed in ms is the last contact timestamp.

Backport of #3769

Signed-off-by: Max <[email protected]>
max-nextcloud added a commit that referenced this pull request Feb 7, 2023
The collaborator disconnect timeout is in ms as are all intervals.
So we can directly subtract it from `Date.now()` - which also is in ms.
The only time that is not expressed in ms is the last contact timestamp.

Backport of #3769

Signed-off-by: Max <[email protected]>
max-nextcloud added a commit that referenced this pull request Feb 7, 2023
The collaborator disconnect timeout is in ms as are all intervals.
So we can directly subtract it from `Date.now()` - which also is in ms.
The only time that is not expressed in ms is the last contact timestamp.

Backport of #3769

Signed-off-by: Max <[email protected]>
max-nextcloud added a commit that referenced this pull request Feb 8, 2023
The collaborator disconnect timeout is in ms as are all intervals.
So we can directly subtract it from `Date.now()` - which also is in ms.
The only time that is not expressed in ms is the last contact timestamp.

Backport of #3769

Signed-off-by: Max <[email protected]>
max-nextcloud added a commit that referenced this pull request Feb 8, 2023
The collaborator disconnect timeout is in ms as are all intervals.
So we can directly subtract it from `Date.now()` - which also is in ms.
The only time that is not expressed in ms is the last contact timestamp.

Backport of #3769

Signed-off-by: Max <[email protected]>
nextcloud-command pushed a commit that referenced this pull request Feb 8, 2023
The collaborator disconnect timeout is in ms as are all intervals.
So we can directly subtract it from `Date.now()` - which also is in ms.
The only time that is not expressed in ms is the last contact timestamp.

Backport of #3769

Signed-off-by: Max <[email protected]>
Signed-off-by: nextcloud-command <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants