-
Notifications
You must be signed in to change notification settings - Fork 428
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
Remove domain/catch hook errors #3775
Changes from all commits
aec0106
abc5499
9458f48
7ee654e
2710bd4
f04024f
f875416
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -341,15 +341,18 @@ remove_archive(Acc, HostType, ArcID, _ArcJID) -> | |||
mongoose_rdbms:execute_successfully(HostType, mam_archive_remove, [ArcID]), | ||||
Acc. | ||||
|
||||
-spec remove_domain(mongoose_hooks:simple_acc(), host_type(), jid:lserver()) -> | ||||
mongoose_hooks:simple_acc(). | ||||
-spec remove_domain(mongoose_domain_api:remove_domain_acc(), host_type(), jid:lserver()) -> | ||||
mongoose_domain_api:remove_domain_acc(). | ||||
remove_domain(Acc, HostType, Domain) -> | ||||
{atomic, _} = mongoose_rdbms:sql_transaction(HostType, fun() -> | ||||
mongoose_rdbms:execute_successfully(HostType, mam_remove_domain, [Domain]), | ||||
mongoose_rdbms:execute_successfully(HostType, mam_remove_domain_prefs, [Domain]), | ||||
mongoose_rdbms:execute_successfully(HostType, mam_remove_domain_users, [Domain]) | ||||
end), | ||||
Acc. | ||||
F = fun() -> | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is really unexpected that this function is (and most likely was already) untouched by tests. Could you investigate? I thought we had tests for domain removal for MAM. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No idea, I just ran locally with coverage and it is green in the report generated here, I don't know why it wasn't for codecov 😕 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. codecov says that for master is also red: https://app.codecov.io/gh/esl/MongooseIM/blob/master/src/mam/mod_mam_rdbms_arch.erl so well, I'm sure we have a test for it, in
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, let's leave it for now |
||||
{atomic, _} = mongoose_rdbms:sql_transaction(HostType, fun() -> | ||||
mongoose_rdbms:execute_successfully(HostType, mam_remove_domain, [Domain]), | ||||
mongoose_rdbms:execute_successfully(HostType, mam_remove_domain_prefs, [Domain]), | ||||
mongoose_rdbms:execute_successfully(HostType, mam_remove_domain_users, [Domain]) | ||||
end), | ||||
Acc | ||||
end, | ||||
mongoose_domain_api:remove_domain_wrapper(Acc, F, ?MODULE). | ||||
|
||||
%% GDPR logic | ||||
extract_gdpr_messages(Env, ArcID) -> | ||||
|
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.
Maybe it's only me, but I think the name suggests that it removes a domain wrapper. No need to fix.