-
Notifications
You must be signed in to change notification settings - Fork 909
Bugfix/enforce enterprise update channel #9139
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
Conversation
| const auto currentChannel = UpdateChannel::fromString(settings.value(QLatin1String(updateChannelC), defaultUpdateChannel()).toString()); | ||
| const auto enterpriseChannel = UpdateChannel::fromString(desktopEnterpriseChannel()); | ||
| return UpdateChannel::mostStable(currentChannel, enterpriseChannel).toString(); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO these methods should return the values for the corresponding keys in the config file.
Keep in mind that the value of the desired enterprise channel should only be considered for unbranded clients connected to a server with a valid subscription, while branded clients only have the stable channel available.
also, since there is now a separate UpdateChannel class I think it would be cleaner to:
- move the methods related to the update channel that are not really modifying the configuration from
ConfigFileto that one (e.g.defaultUpdateChannelandvalidUpdateChannels) - add a function that determines the desired update channel (pretty much what
defaultUpdateChanneldoes), and pass that as thechannelquery parameter inOCC::Updater - perhaps add some unit tests to verify which updater channel should be used
src/gui/application.cpp
Outdated
| // In the config, set the enterprise update channel to invalid, so it can be bumped up | ||
| // when recieving server capabilites. | ||
| ConfigFile configFile; | ||
| configFile.setDesktopEnterpriseChannel(UpdateChannel::fromString("invalid").toString()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with the current implementation of ConfigFile::setDesktopEnterpriseChannel this won't have any effect if the update channel is already set to enterprise
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right. The info shown by the client mislead me.
| // In the config, set the enterprise update channel to invalid, so it can be bumped up | ||
| // when recieving server capabilites. | ||
| ConfigFile configFile; | ||
| configFile.setDesktopEnterpriseChannel(UpdateChannel::fromString("invalid").toString()); | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so on every start, we will force override the value of the setting
why are we storing it if we are doing that ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is a good question. It was already there. But you're right it doesn't need to be in the config actually... I'll think some more about this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now I think it's best to leave this config option in the config file. I cannot use a plain member in this class, because we create a new instance every time we want to access the config. I cannot really think of good place to put it either, because it is needed from multiple places. To leave it here is convenient.
src/libsync/updatechannel.cpp
Outdated
| @@ -0,0 +1,60 @@ | |||
| /* | |||
| * SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors | |||
| * SPDX-FileCopyrightText: 2025 ownCloud GmbH | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a new class not originally present in the forked-from codebase
| * SPDX-FileCopyrightText: 2025 ownCloud GmbH |
src/libsync/updatechannel.h
Outdated
| @@ -0,0 +1,44 @@ | |||
| /* | |||
| * SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors | |||
| * SPDX-FileCopyrightText: 2025 ownCloud GmbH | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a new class not originally present in the forked-from codebase
| * SPDX-FileCopyrightText: 2025 ownCloud GmbH |
src/libsync/account.cpp
Outdated
| { | ||
| const auto capabilityEnterpriseChannel = UpdateChannel::fromString(_capabilities.desktopEnterpriseChannel()); | ||
| _enterpriseUpdateChannel = capabilityEnterpriseChannel; | ||
| qCInfo(lcAccount()) << "lulu | enterp chn updated: " << _enterpriseUpdateChannel.toString() << " str: " << _capabilities.desktopEnterpriseChannel(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| qCInfo(lcAccount()) << "lulu | enterp chn updated: " << _enterpriseUpdateChannel.toString() << " str: " << _capabilities.desktopEnterpriseChannel(); | |
| qCInfo(lcAccount()) << "Account" << id() << "received enterprise channel:" << _enterpriseUpdateChannel.toString(); |
src/gui/accountmanager.cpp
Outdated
| { | ||
| UpdateChannel most_stable_channel = UpdateChannel::Invalid; | ||
| for (const auto &account : std::as_const(_accounts)) { | ||
| if (auto accounts_channel = account->account()->enterpriseUpdateChannel(); accounts_channel > most_stable_channel) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might want to exclude accounts not having a valid subscription here as well
nilsding
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test itself looks fine to me, thanks :)
test/testupdatechannel.cpp
Outdated
| FileInfo fi; | ||
| reply = new FakeFakeDeleteReply(this); | ||
| return reply; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- please add a comment why this QNAM override is required (e.g. side-effect of AccountManager::deleteAccount)
- wouldn't an empty
FakePayloadReplybe enough here?Suggested changeFileInfo fi; reply = new FakeFakeDeleteReply(this); return reply; reply = new FakePayloadReply(op, req, {}, this);
65b9865 to
116de06
Compare
[issue 9004] Signed-off-by: Tamás Bari <[email protected]>
But only if it's more stable. Signed-off-by: Tamás Bari <[email protected]>
but override it. Signed-off-by: Tamás Bari <[email protected]>
Force set the enterprise channel to invalid on startup. Only provide the enterprise update channel is the server has a valid subscription. Signed-off-by: Tamás Bari <[email protected]>
This approach integrates better into the current mechanisms. Signed-off-by: Tamás Bari <[email protected]>
According to review suggetsions. Signed-off-by: Tamás Bari <[email protected]>
…annel. Signed-off-by: Tamás Bari <[email protected]>
Signed-off-by: Tamás Bari <[email protected]>
Signed-off-by: Tamás Bari <[email protected]>
…has a valid subscription Signed-off-by: Tamás Bari <[email protected]>
Signed-off-by: Tamás Bari <[email protected]>
Signed-off-by: Tamás Bari <[email protected]>
Also removing the new one which did the same thing. Signed-off-by: Tamás Bari <[email protected]>
Signed-off-by: Tamás Bari <[email protected]>
Signed-off-by: Tamás Bari <[email protected]>
bf94adf to
8463862
Compare
|
Artifact containing the AppImage: nextcloud-appimage-pr-9139.zip Digest: To test this change/fix you can download the above artifact file, unzip it, and run it. Please make sure to quit your existing Nextcloud app and backup your data. |
|
|
/backport to stable-4.0 |
|
Hello there, We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process. Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6 Thank you for contributing to Nextcloud and we hope to hear from you soon! (If you believe you should not receive this message, you can add yourself to the blocklist.) |




Solves #9004
The idea is: