mod_cloud_notify: Abort and return error if unable to read storage to prevent loss of existing but unreachable data
--- a/mod_cloud_notify/mod_cloud_notify.lua Thu Jul 28 12:35:57 2016 +0200
+++ b/mod_cloud_notify/mod_cloud_notify.lua Thu Jul 28 12:36:59 2016 +0200
@@ -42,8 +42,13 @@
-- Could be intentional
origin.log("debug", "No publish options in request");
end
- local user_push_services = push_enabled:get(origin.username);
+ local user_push_services, rerr = push_enabled:get(origin.username);
if not user_push_services then
+ if rerr then
+ module:log("warn", "Error reading push notification storage: %s", rerr);
+ origin.send(st.error_reply(stanza, "wait", "internal-server-error"));
+ return true;
+ end
user_push_services = {};
end
user_push_services[push_jid .. "<" .. (push_node or "")] = {