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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(api): Ignore "parsed" link and icon urls when deleting #1858

Merged
merged 1 commit into from
Mar 21, 2024

Conversation

nickvergessen
Copy link
Member

Tested on prod for myself after seeing that I had 73 notifications in the database but only 2 displayed in the UI.

The problem is Talk and some others don't have an icon/link stored in the database (as they might change), instead they are added on rendering, e.g. here:
https://github.com/nextcloud/spreed/blob/eb45b2eb8787207d072e5399da50f24f000df658/lib/Notification/Notifier.php#L242-L244

However Talk does this generally up front, so when it later on says "alright, the chat was read already, lets mark the notification as processed":
https://github.com/nextcloud/spreed/blob/eb45b2eb8787207d072e5399da50f24f000df658/lib/Notification/Notifier.php#L487-L498
the data is already manipulated.

Notifications app is then asked to delete the notification, but it adds the non-empty link and icon to the query, they are empty in the DB => No match => No delete

I think it's save to assume that link and icon are never used as "uniqueness" factor and therefore we can ignore them on deletion.

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

🐢 Performance warning.
It looks like the query count of the integration tests increased with this PR.
Database query count is now 8549 was 8200 (+4.25%)
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 ede7be8 into master Mar 21, 2024
43 checks passed
@nickvergessen nickvergessen deleted the bugfix/noid/ignore-icon-and-link-on-deletion branch March 21, 2024 16:52
@nickvergessen
Copy link
Member Author

/backport to stable28

@nickvergessen
Copy link
Member Author

/backport to stable27

@nickvergessen
Copy link
Member Author

/backport to stable26

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.

2 participants