You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
github-actionsbot
changed the title
EmailQuotaService has unnecessary ISession.SaveAsync() calls
EmailQuotaService has unnecessary ISession.SaveAsync() calls (OSOE-848)
May 3, 2024
I removed all and after that just some of the SaveAsync() calls and experienced broken behavior and failing UI tests. I sense that they might indeed be necessary.
"in the EmailQuotaService all the methods updating the quota instance also call SaveAsync but it's not necessary since it's either coming from the database or being created and then tracked"
For example when removing it from IncreaseEmailUsageAsync it is just not counting the emails sent.
If I remove the others the tests are still working but this can be due to the Tests not touching those funcionalities that would be broken upon removing these.
But I highly suspect that if emailQuota.CurrentEmailUsageCount++ is not working without SaveAsync then emailQuota.CurrentEmailUsageCount = 0; shouldn't be working aswell it is just not tested.
While those shouldn't be necessary. See OrchardCMS/OrchardCore#15290 (comment).
Jira issue
The text was updated successfully, but these errors were encountered: