Skip to content

Conversation

@nickvergessen
Copy link
Member

Fix #1483

…lient handling it

Signed-off-by: Joas Schilling <coding@schilljs.com>
…p client is there

Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Joas Schilling <coding@schilljs.com>
@github-actions
Copy link
Contributor

🐢 Performance warning.
It looks like the query count of the integration tests increased with this PR.
Database query count is now 9812 was 9500 (+3.28%)
Please check your code again. If you added a new test this can be expected and the base value in tests/Integration/base-query-count.txt can be increased.

Comment on lines +32 to +40
$result = $query->executeQuery();
while ($row = $result->fetch()) {
\OC::$server->getLogger()->error(json_encode($row['name']));
if (preg_match('/ \(Talk Desktop Client - [A-Za-z ]+\)$/', $row['name'])) {
$result->closeCursor();
return true;
}
}
$result->closeCursor();
Copy link
Contributor

@ShGKme ShGKme Mar 15, 2023

Choose a reason for hiding this comment

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

From a perf perspective, wouldn't it be better to add this as a part of SQL query?
Aka AND name LIKE ' %(Talk Desktop Client -%)'

Copy link
Member Author

Choose a reason for hiding this comment

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

That breaks index usage as far as I remember, and the result set afterwards is so small we are better off checking the few for your user afterwards.
But will check again which indexes are available, but I'm pretty sure name had none

Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Joas Schilling <coding@schilljs.com>
Copy link
Contributor

@ShGKme ShGKme left a comment

Choose a reason for hiding this comment

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

Works 👀

@nickvergessen
Copy link
Member Author

/backport to stable26

Signed-off-by: Joas Schilling <coding@schilljs.com>
@nickvergessen nickvergessen force-pushed the feature/1483/deduplicate-notifications branch from e0fa7ca to f15c047 Compare March 16, 2023 14:10
@github-actions
Copy link
Contributor

🐢 Performance warning.
It looks like the query count of the integration tests increased with this PR.
Database query count is now 9812 was 9500 (+3.28%)
Please check your code again. If you added a new test this can be expected and the base value in tests/Integration/base-query-count.txt can be increased.

@nickvergessen nickvergessen merged commit e68d683 into master Mar 16, 2023
@nickvergessen nickvergessen deleted the feature/1483/deduplicate-notifications branch March 16, 2023 16:03
@backportbot-nextcloud
Copy link

The backport to stable26 failed. Please do this backport manually.

# Switch to the target branch and update it
git checkout stable26
git pull origin/stable26

# Create the new backport branch
git checkout -b fix/foo-stable26

# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts. Resolve them.
git cherry-pick abc123

# Push the cherry pick commit to the remote repository and open a pull request
git push origin fix/foo-stable26

More info at https://docs.nextcloud.com/server/latest/developer_manual/getting_started/development_process.html#manual-backport

@nickvergessen
Copy link
Member Author

Backport in #1485

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Duplicated notifications

4 participants