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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not fetch activities if they are not enabled #859

Merged
merged 2 commits into from Nov 19, 2018

Conversation

Projects
None yet
2 participants
@rullzer
Copy link
Member

commented Nov 19, 2018

Fixes #788
Fixes #834

  1. Disable activities app on the server
  2. Open client
  3. Open activities tab

Before:

  • observe a 馃挬-ton of requests to your server

After:

  • No 馃挬-ton of requests to your server
Do not fetch activities if they are not enabled
Fixes #788
Fixes #834

If the activity app is not enabled we should not try to fetch the
activities at all.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
@jpnurmi

This comment has been minimized.

Copy link
Member

commented Nov 19, 2018

I can still reproduce the problem with a test account I created on webo.hosting, with activities enabled. :( On the first run, when I add the account, the flood starts when I scroll to the bottom of the activity list. On the second run, the flood starts immediately on startup and the activity list is empty.

Server v14.0.3.0:

[OCC::CheckServerJob::finished 	status.php returns:  QJsonDocument({"edition":"","installed":true,"maintenance":false,"needsDbUpgrade":false,"productname":"Nextcloud by Webo.hosting","version":"14.0.3.0","versionstring":"14.0.3"})   QNetworkReply::NetworkError(NoError)  Reply:  QNetworkReplyHttpImpl(0x555555fdac50)

Has activities capability:

[OCC::JsonApiJob::finished 	JsonApiJob of QUrl("https://nextcloud-fi.webo.hosting/ocs/v1.php/cloud/capabilities?format=json") FINISHED WITH STATUS "OK"
[OCC::ConnectionValidator::slotCapabilitiesRecieved 	Server capabilities QJsonObject({"activity":{"apiv2":["filters","filters-api","previews","rich-strings"]},"bruteforce":{"delay":0},"core":{"pollinterval":60,"webdav-root":"remote.php/webdav"},"dav":{"chunking":"1.0"},"external":{"v1":["sites","device","groups","redirect"]},"files":{"bigfilechunking":true,"blacklisted_files":[".htaccess"],"undelete":true,"versioning":true},"files_sharing":{"api_enabled":true,"default_permissions":31,"federation":{"expire_date":{"enabled":true},"incoming":true,"outgoing":true},"group":{"enabled":false,"expire_date":{"enabled":true}},"group_sharing":false,"public":{"enabled":true,"expire_date":{"enabled":false},"password":{"enforced":false},"send_mail":false,"upload":true,"upload_files_drop":true},"resharing":true,"sharebymail":{"enabled":true,"expire_date":{"enabled":true},"password":{"enabled":true},"upload_files_drop":{"enabled":true}},"user":{"expire_date":{"enabled":true},"send_mail":false}},"fulltextsearch":{"providers":[],"remote":true},"notifications":{"admin-notifications":["ocs","cli"],"ocs-endpoints":["list","get","delete","delete-all","icons","rich-strings"],"push":["devices","object-data"]},"ocm":{"apiVersion":"1.0-proposal1","enabled":true,"endPoint":"https://nextcloud-fi.webo.hosting/index.php/ocm","shareTypes":[{"name":"file","protocols":{"webdav":"/public.php/webdav/"}}]},"password_policy":{"enforceNonCommonPassword":true,"enforceNumericCharacters":true,"enforceSpecialCharacters":true,"enforceUpperLowerCase":true,"minLength":8},"richdocuments":{"mimetypes":["application/vnd.oasis.opendocument.text","application/vnd.oasis.opendocument.spreadsheet","application/vnd.oasis.opendocument.presentation","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.openxmlformats-officedocument.presentationml.presentation"]},"spreed":{"features":["audio","video","chat-v2","guest-signaling","empty-group-room","guest-display-names","multi-room-users","favorites","last-room-activity","no-ping","system-messages","mention-flag","in-call-flags"]},"theming":{"background":"https://nextcloud-fi.webo.hosting/core/img/background.png?v=5","background-default":true,"background-plain":false,"color":"#0082c9","color-element":"#0082c9","color-text":"#ffffff","logo":"https://nextcloud-fi.webo.hosting/index.php/apps/theming/image/logo?useSvg=1&v=5","name":"Nextcloud by Webo.hosting","slogan":"a safe home for all your data","url":"https://webo.hosting/en/webo-cloud-en/"}})
@rullzer

This comment has been minimized.

Copy link
Member Author

commented Nov 19, 2018

Mmmm so another case it seems.
Let me check that out thnx for testing

@jpnurmi

This comment has been minimized.

Copy link
Member

commented Nov 19, 2018

The loop looks like this:

ActivityListModel::slotRefreshActivity()
-> ActivityListModel::startFetchJob()
-> ActivityListModel::slotActivitiesReceived()
-> ActivityListModel::combineActivityLists()
-> QAbstractItemModel::endInsertRows()
-> QAbstractItemView::rowsInserted() // fetchMoreTimer.start()
-> QAbstractItemView::timerEvent()
-> QAbstractItemViewPrivate::fetchMore()
-> ActivityListModel::fetchMore()
-> ActivityListModel::startFetchJob()
-> ActivityListModel::slotActivitiesReceived()
...
@jpnurmi

This comment has been minimized.

Copy link
Member

commented Nov 19, 2018

The loop can be easily broken by not calling begin/EndResetModel() + begin/endInsertRows() if _finalList == resultList.

EDIT: It leaves the progress indicator spinning forever, though....

void ActivityListModel::fetchMore(const QModelIndex &)
{
if (_accountState->isConnected()) {
_activityLists = ActivityList();
_activityLists = ActivityList();

This comment has been minimized.

Copy link
@jpnurmi

jpnurmi Nov 19, 2018

Member

i'm quite confused why fetchMore() clears previously fetched activities

This comment has been minimized.

Copy link
@rullzer

rullzer Nov 19, 2018

Author Member

That is actually a good question

@jpnurmi
Copy link
Member

left a comment

even though the end result is similar, they are separate issues

@rullzer rullzer merged commit 1afaa22 into master Nov 19, 2018

1 of 2 checks passed

continuous-integration/drone/pr the build failed
Details
fixupbot No fixup commits found. The commit history is clean
Details

@rullzer rullzer deleted the fix/788/no_activity_flood branch Nov 19, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can鈥檛 perform that action at this time.