fix(fcm): use dot-call for prosody.events.fire_event so cache invalidation reaches MUC

prosody.events.fire_event is a plain function (event_name, event_data), not
a method. The colon form prosody.events:fire_event(name, data) passed the
events table as event_name, so the lookup found no handlers and the
vnc-fcm-invalidate-notify-cache / vcard-cache signals were silently lost.

mod_vnc_muc_fcm hooks these via module:hook_global (which registers under
the string event name), so its notify_cache was never invalidated cross-host.
A stale empty cache entry for an MUC affiliate (left by an earlier test
before the user had a token) then suppressed FCM pushes to that affiliate,
breaking test_muc_fcm_push_to_offline_member in the full suite.

Part-of: <http://gitlab.vnc.biz/uxf/vnctalk-prosody/-/merge_requests/11>
This commit is contained in:
2026-07-23 08:40:01 +02:00
parent 2252b08139
commit 1a9b2262c9
+2 -2
View File
@@ -136,12 +136,12 @@ function M.new(ctx)
local function invalidateNotifyCacheGlobal(userName) local function invalidateNotifyCacheGlobal(userName)
invalidateNotifyCache(userName); invalidateNotifyCache(userName);
prosody.events:fire_event("vnc-fcm-invalidate-notify-cache", { username = userName }); prosody.events.fire_event("vnc-fcm-invalidate-notify-cache", { username = userName });
end end
local function invalidateVcardCacheGlobal(userName) local function invalidateVcardCacheGlobal(userName)
invalidateVcardCache(userName); invalidateVcardCache(userName);
prosody.events:fire_event("vnc-fcm-invalidate-vcard-cache", { username = userName }); prosody.events.fire_event("vnc-fcm-invalidate-vcard-cache", { username = userName });
end end
-- ─── display name ──────────────────────────────────────────────── -- ─── display name ────────────────────────────────────────────────