-
Notifications
You must be signed in to change notification settings - Fork 61
perf: Only apply default settings when user is created or settings are requested #2357
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
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.
Good for me code wise, I do not know about the behavior change regarding defaults, waiting for @nickvergessen comment.
aa4948a
to
680927d
Compare
Will check later this week or first week of June |
680927d
to
a7f18a7
Compare
Rebased on master to have a fresh footprint |
The integration test query count is a bit rigged as all requests don't use cookies and therefore authenticate again everytime. So I checked PMM and there were 562k SELECT * FROM `oc_notifications_settings` WHERE `user_id` = ? queries last week. |
So this change makes sense? I'm not sure I understand what you are trying to imply. |
Not sure, I'd prefer to keep it on login, so that users that get their entry dropped recover automatically by some login. Otherwise we'd need to remove the The main problem is that without this entry, users will not be considered anymore to receive notification reminder emails, which would be rather critical. But we have a listener for creation and it's recovering when opening the settings.
|
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.
As per above
a7f18a7
to
fd7c610
Compare
fd7c610
to
69977e4
Compare
…e requested Signed-off-by: provokateurin <[email protected]>
Signed-off-by: Joas Schilling <[email protected]>
Signed-off-by: Joas Schilling <[email protected]>
Signed-off-by: Joas Schilling <[email protected]>
c98cb9f
to
41ebb56
Compare
Before merging we need to check the query count of the performance test, in case it changed more than just a bit |
Signed-off-by: Joas Schilling <[email protected]>
Before every authenticated request caused a query (
SELECT * FROM "oc_notifications_settings" WHERE "user_id" = :dcValue1; {"dcValue1":"admin"}
) which was largely unnecessary, stemming from the PostLoginListener.Now the default settings are only initialized when the settings are requested and don't exist already.
To make sure the next send time is set for new users, the default settings are also initialized when a new user is created.
A tiny additional improvement is that the user values are not set now if the user doesn't change them, so if the app default is updated the user default will be updated as well (and it saves the additional queries to insert the rows into the table).