Skip to content

Commit

Permalink
default pollintervall 30000 msec
Browse files Browse the repository at this point in the history
The desktop client uses a default poll interval of 30000 msec whenever the capabilities announce something less than 5000.
To get in sync with this behaviour, I suggest to also change the value here to 30000.

A value of 60 also leads to confusion, as users asume the unit is seconds, which it is not.

Suggestion for future: Hardcode the unit in the name of the variable, like. e.g. `pollinterval_msec`
  • Loading branch information
jnweiger authored and phil-davis committed Feb 22, 2022
1 parent a0a4064 commit c66be9c
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 27 deletions.
6 changes: 6 additions & 0 deletions changelog/unreleased/39143
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Change: Update the default poll-interval in capabilities

The default pollinterval advertised in capabilities has been set to
30000 milliseconds. Previously it was 60 milliseconds.

https://github.com/owncloud/core/pull/39143
10 changes: 10 additions & 0 deletions config/config.sample.php
Original file line number Diff line number Diff line change
Expand Up @@ -1491,6 +1491,16 @@
*/
'minimum.supported.desktop.version' => '2.3.3',

/**
* Define the suggested poll interval for clients
* Specifies how often clients should poll the server for changes.
* The value is in milliseconds. The value is not enforced.
* Clients may use this value to decide how frequently to check the server for
* changes.
*
*/
'pollinterval' => 30000,

/**
* Define whether to include external storage in quota calculation
* EXPERIMENTAL: option whether to include external storage in quota
Expand Down
3 changes: 2 additions & 1 deletion lib/private/OCS/CoreCapabilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ public function __construct(IConfig $config) {
public function getCapabilities() {
return [
'core' => [
'pollinterval' => $this->config->getSystemValue('pollinterval', 60),
// pollinterval is an integer number of milliseconds
'pollinterval' => $this->config->getSystemValue('pollinterval', 30000),
'webdav-root' => $this->config->getSystemValue('webdav-root', 'remote.php/webdav'),
'status' => Util::getStatusInfo(true),
'support-url-signing' => true,
Expand Down
50 changes: 25 additions & 25 deletions tests/acceptance/features/apiCapabilities/capabilities.feature
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Feature: capabilities
And the HTTP status code should be "200"
And the capabilities should contain
| capability | path_to_element | value |
| core | pollinterval | 60 |
| core | pollinterval | 30000 |
| core | webdav-root | remote.php/webdav |
| core | status@@@edition | %edition% |
| core | status@@@productname | %productname% |
Expand Down Expand Up @@ -304,7 +304,7 @@ Feature: capabilities
And the HTTP status code should be "200"
And the capabilities should contain
| capability | path_to_element | value |
| core | pollinterval | 60 |
| core | pollinterval | 30000 |
| core | webdav-root | remote.php/webdav |
| files_sharing | api_enabled | 1 |
| files_sharing | can_share | 1 |
Expand All @@ -329,7 +329,7 @@ Feature: capabilities
And the HTTP status code should be "200"
And the capabilities should contain
| capability | path_to_element | value |
| core | pollinterval | 60 |
| core | pollinterval | 30000 |
| core | webdav-root | remote.php/webdav |
| files_sharing | api_enabled | EMPTY |
| files_sharing | can_share | EMPTY |
Expand All @@ -348,7 +348,7 @@ Feature: capabilities
And the HTTP status code should be "200"
And the capabilities should contain
| capability | path_to_element | value |
| core | pollinterval | 60 |
| core | pollinterval | 30000 |
| core | webdav-root | remote.php/webdav |
| files_sharing | api_enabled | 1 |
| files_sharing | can_share | 1 |
Expand All @@ -371,7 +371,7 @@ Feature: capabilities
And the HTTP status code should be "200"
And the capabilities should contain
| capability | path_to_element | value |
| core | pollinterval | 60 |
| core | pollinterval | 30000 |
| core | webdav-root | remote.php/webdav |
| files_sharing | api_enabled | 1 |
| files_sharing | can_share | 1 |
Expand All @@ -395,7 +395,7 @@ Feature: capabilities
And the HTTP status code should be "200"
And the capabilities should contain
| capability | path_to_element | value |
| core | pollinterval | 60 |
| core | pollinterval | 30000 |
| core | webdav-root | remote.php/webdav |
| files_sharing | api_enabled | 1 |
| files_sharing | can_share | 1 |
Expand All @@ -419,7 +419,7 @@ Feature: capabilities
And the HTTP status code should be "200"
And the capabilities should contain
| capability | path_to_element | value |
| core | pollinterval | 60 |
| core | pollinterval | 30000 |
| core | webdav-root | remote.php/webdav |
| files_sharing | api_enabled | 1 |
| files_sharing | can_share | 1 |
Expand All @@ -443,7 +443,7 @@ Feature: capabilities
And the HTTP status code should be "200"
And the capabilities should contain
| capability | path_to_element | value |
| core | pollinterval | 60 |
| core | pollinterval | 30000 |
| core | webdav-root | remote.php/webdav |
| files_sharing | api_enabled | 1 |
| files_sharing | can_share | 1 |
Expand All @@ -470,7 +470,7 @@ Feature: capabilities
And the HTTP status code should be "200"
And the capabilities should contain
| capability | path_to_element | value |
| core | pollinterval | 60 |
| core | pollinterval | 30000 |
| core | webdav-root | remote.php/webdav |
| files_sharing | api_enabled | 1 |
| files_sharing | can_share | 1 |
Expand All @@ -497,7 +497,7 @@ Feature: capabilities
And the HTTP status code should be "200"
And the capabilities should contain
| capability | path_to_element | value |
| core | pollinterval | 60 |
| core | pollinterval | 30000 |
| core | webdav-root | remote.php/webdav |
| files_sharing | api_enabled | 1 |
| files_sharing | can_share | 1 |
Expand All @@ -524,7 +524,7 @@ Feature: capabilities
And the HTTP status code should be "200"
And the capabilities should contain
| capability | path_to_element | value |
| core | pollinterval | 60 |
| core | pollinterval | 30000 |
| core | webdav-root | remote.php/webdav |
| files_sharing | api_enabled | 1 |
| files_sharing | can_share | 1 |
Expand All @@ -548,7 +548,7 @@ Feature: capabilities
And the HTTP status code should be "200"
And the capabilities should contain
| capability | path_to_element | value |
| core | pollinterval | 60 |
| core | pollinterval | 30000 |
| core | webdav-root | remote.php/webdav |
| files_sharing | api_enabled | 1 |
| files_sharing | can_share | 1 |
Expand All @@ -572,7 +572,7 @@ Feature: capabilities
And the HTTP status code should be "200"
And the capabilities should contain
| capability | path_to_element | value |
| core | pollinterval | 60 |
| core | pollinterval | 30000 |
| core | webdav-root | remote.php/webdav |
| files_sharing | api_enabled | 1 |
| files_sharing | can_share | 1 |
Expand All @@ -598,7 +598,7 @@ Feature: capabilities
And the HTTP status code should be "200"
And the capabilities should contain
| capability | path_to_element | value |
| core | pollinterval | 60 |
| core | pollinterval | 30000 |
| core | webdav-root | remote.php/webdav |
| files_sharing | api_enabled | 1 |
| files_sharing | can_share | 1 |
Expand All @@ -624,7 +624,7 @@ Feature: capabilities
And the HTTP status code should be "200"
And the capabilities should contain
| capability | path_to_element | value |
| core | pollinterval | 60 |
| core | pollinterval | 30000 |
| core | webdav-root | remote.php/webdav |
| files_sharing | api_enabled | 1 |
| files_sharing | can_share | 1 |
Expand All @@ -648,7 +648,7 @@ Feature: capabilities
And the HTTP status code should be "200"
And the capabilities should contain
| capability | path_to_element | value |
| core | pollinterval | 60 |
| core | pollinterval | 30000 |
| core | webdav-root | remote.php/webdav |
| files_sharing | api_enabled | 1 |
| files_sharing | can_share | 1 |
Expand All @@ -672,7 +672,7 @@ Feature: capabilities
And the HTTP status code should be "200"
And the capabilities should contain
| capability | path_to_element | value |
| core | pollinterval | 60 |
| core | pollinterval | 30000 |
| core | webdav-root | remote.php/webdav |
| files_sharing | api_enabled | 1 |
| files_sharing | can_share | 1 |
Expand All @@ -697,7 +697,7 @@ Feature: capabilities
And the HTTP status code should be "200"
And the capabilities should contain
| capability | path_to_element | value |
| core | pollinterval | 60 |
| core | pollinterval | 30000 |
| core | webdav-root | remote.php/webdav |
| files_sharing | api_enabled | 1 |
| files_sharing | can_share | 1 |
Expand All @@ -723,7 +723,7 @@ Feature: capabilities
And the HTTP status code should be "200"
And the capabilities should contain
| capability | path_to_element | value |
| core | pollinterval | 60 |
| core | pollinterval | 30000 |
| core | webdav-root | remote.php/webdav |
| files_sharing | api_enabled | 1 |
| files_sharing | can_share | 1 |
Expand All @@ -746,7 +746,7 @@ Feature: capabilities
And the HTTP status code should be "200"
And the capabilities should contain
| capability | path_to_element | value |
| core | pollinterval | 60 |
| core | pollinterval | 30000 |
| core | webdav-root | remote.php/webdav |
| files_sharing | api_enabled | 1 |
| files_sharing | can_share | 1 |
Expand All @@ -770,7 +770,7 @@ Feature: capabilities
And the HTTP status code should be "200"
And the capabilities should contain
| capability | path_to_element | value |
| core | pollinterval | 60 |
| core | pollinterval | 30000 |
| core | webdav-root | remote.php/webdav |
| files_sharing | api_enabled | 1 |
| files_sharing | can_share | 1 |
Expand Down Expand Up @@ -799,7 +799,7 @@ Feature: capabilities
And the HTTP status code should be "200"
And the capabilities should contain
| capability | path_to_element | value |
| core | pollinterval | 60 |
| core | pollinterval | 30000 |
| core | webdav-root | remote.php/webdav |
| files_sharing | api_enabled | 1 |
| files_sharing | can_share | 1 |
Expand Down Expand Up @@ -830,7 +830,7 @@ Feature: capabilities
And the HTTP status code should be "200"
And the capabilities should contain
| capability | path_to_element | value |
| core | pollinterval | 60 |
| core | pollinterval | 30000 |
| core | webdav-root | remote.php/webdav |
| files_sharing | api_enabled | 1 |
| files_sharing | can_share | EMPTY |
Expand Down Expand Up @@ -861,7 +861,7 @@ Feature: capabilities
And the HTTP status code should be "200"
And the capabilities should contain
| capability | path_to_element | value |
| core | pollinterval | 60 |
| core | pollinterval | 30000 |
| core | webdav-root | remote.php/webdav |
| files_sharing | api_enabled | 1 |
| files_sharing | can_share | 1 |
Expand Down Expand Up @@ -893,7 +893,7 @@ Feature: capabilities
And the HTTP status code should be "200"
And the capabilities should contain
| capability | path_to_element | value |
| core | pollinterval | 60 |
| core | pollinterval | 30000 |
| core | webdav-root | remote.php/webdav |
| files_sharing | api_enabled | 1 |
| files_sharing | can_share | EMPTY |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Feature: default capabilities for normal user
And the HTTP status code should be "200"
And the capabilities should contain
| capability | path_to_element | value |
| core | pollinterval | 60 |
| core | pollinterval | 30000 |
| core | webdav-root | remote.php/webdav |
| core | status@@@edition | %edition% |
| core | status@@@productname | %productname% |
Expand Down

0 comments on commit c66be9c

Please sign in to comment.