40 Commits
Author SHA1 Message Date
Stefan-Sanger 1a9b2262c9 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>
2026-07-23 08:40:01 +02:00
Stefan-Sanger 2252b08139 fix(fcm): pass full JID to fcm_notify and use st.clone in MUC handler
fcm_notify splits userName internally via jid_split, so callers were
double-splitting: passing jid_split(to) fed the bare node as userName
and shifted every subsequent argument by one (host→title, resource→body,
…), corrupting all notification payloads. Pass the full JID instead.

In mod_vnc_muc_fcm, replace event.stanza:clone() with st.clone() and
add the util.stanza import for robustness.

Part-of: <http://gitlab.vnc.biz/uxf/vnctalk-prosody/-/merge_requests/11>
2026-07-22 16:33:17 +02:00
Stefan-Sanger 94ee78f115 refactor(fcm): extract shared FCM logic into vnc_fcm_common.lua
- Extract ~90% duplicated code from mod_vnc_fcm and mod_vnc_muc_fcm
- Add notify_cache (300s) and vcard_cache (600s) with cross-module invalidation
- Hoist getDisplayName before MUC affiliate loop
- Defer MUC affiliate notifications via timer.add_task(0, ...)
- Remove bare_sessions diagnostic scan, dead code, and per-send option lookups
- Fix read-receipt routing and respect MUC lang preference
- Unify stale-token cleanup (NotRegistered/etc.) in both modules

Part-of: <http://gitlab.vnc.biz/uxf/vnctalk-prosody/-/merge_requests/11>
2026-07-22 15:07:01 +02:00
Stefan-Sanger 1affb3acc3 fix: use Prosody 13 get_room_from_jid API in broadcast/FCM MUC fanout
mod_vnc_broadcast and mod_vnc_fcm accessed the deprecated
prosody.hosts[host].modules.muc.rooms[to] table, removed in Prosody 13,
triggering 'Attempt to read a non-existent global rooms' warnings and
silently breaking MUC affiliation fan-out for broadcasts and push.

Replace with a version-safe get_room_from_jid() helper (rawget fallback
to .rooms for older Prosody), matching the pattern already in
mod_vcard_muc. Guard _affiliations access behind a nil room check.

Part-of: <http://gitlab.vnc.biz/uxf/vnctalk-prosody/-/merge_requests/7>
2026-07-16 08:00:57 +02:00
Stefan-Sangerandmarge e98f9cf4c9 perf: add global LRU cache to mod_vnc_lastactivity store reads
Add a module-scoped util.cache LRU (lastactivity_cache_size default 5000,
lastactivity_cache_ttl default 300s) in front of the activity_store /
remote_activity_store fallback. Write-through on all set sites
(authentication-success, local last-session unavailable, remote
unavailable) and read-through in both IQ handlers (batch and standard
jabber:iq:last), so repeated last-activity queries for the same contacts
no longer hit the synchronous SQL driver, reducing event-loop blocking.

Also removes dead code (avatar-hash helpers, dumpTable, unused imports,
commented-out debug logging) and the unused remote avatar-update tracking.

Part-of: <http://gitlab.vnc.biz/uxf/vnctalk-prosody/-/merge_requests/5>
2026-07-16 04:26:15 +00:00
Stefan-Sangerandmarge 658008606a Revert "perf: buffer mod_vnc_lastactivity DB writes and flush periodically"
back to original code for further analysis and improvement

This reverts commit 83e578cb94.

Part-of: <http://gitlab.vnc.biz/uxf/vnctalk-prosody/-/merge_requests/5>
2026-07-16 04:26:15 +00:00
Stefan-Sanger 83e578cb94 perf: buffer mod_vnc_lastactivity DB writes and flush periodically
The store :set() calls go through mod_storage_sql (LuaDBI), a blocking C
client. These hooks fire on the presence/auth hot path, so inline writes
stall the event loop under presence storms. Buffer writes in memory and
flush every 5 seconds (configurable via vnc_lastactivity_flush_interval).
The IQ handlers already read from in-memory map/remote_act_cache first,
so read consistency is preserved. Final flush on server-stopping and
host-deactivating prevents data loss on graceful shutdown.

Part-of: <http://gitlab.vnc.biz/uxf/vnctalk-prosody/-/merge_requests/3>
2026-07-15 17:58:02 +02:00
Stefan-Sanger 2a79ed2103 chore: remove unused mod_auth_any auth provider
mod_auth_any is never enabled in the config (auth is internal_hashed,
http_async, or anonymous) and nothing references it.

Part-of: <http://gitlab.vnc.biz/uxf/vnctalk-prosody/-/merge_requests/3>
2026-07-15 17:58:02 +02:00
Stefan-Sanger 5179be85a0 chore: remove unused mod_vnc_fcm_hin and mod_vnc_muc_fcm_hin modules
Neither _hin variant is enabled in the config (the active push modules
are mod_vnc_fcm for 1:1 and mod_vnc_muc_fcm for MUC). Drop the dead
files and update AGENTS.md to reference the active modules.

Part-of: <http://gitlab.vnc.biz/uxf/vnctalk-prosody/-/merge_requests/3>
2026-07-15 17:58:02 +02:00
Stefan-SangerandClaude Opus 4.8 c05bb9aadb fix(muc): serialize e2e roominfo as string in disco#info
mod_vnc_e2ehints put the raw boolean returned by get_e2e() (false when
unset) into the disco#info roominfo formdata. muc#roominfo_e2e is a
text-single field, and util.dataforms/util.stanza cannot serialize a
boolean field value, so room:get_disco_info() raised an error and the
server silently dropped the disco#info reply for every existing room
(confirmed at the wire level: non-existent rooms returned item-not-found,
existing rooms returned nothing). Coerce the value to a string, matching
the working mod_vnc_muc_data pattern. get_e2e() itself is left returning a
boolean since the muc-config-form boolean field needs it.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Part-of: <http://gitlab.vnc.biz/uxf/vnctalk-prosody/-/merge_requests/3>
2026-07-15 17:58:02 +02:00
Stefan-SangerandClaude Fable 5 bdb9aed9e3 feat: upgrade prosody 0.11.6 -> 0.12.6 (milestone 1)
Re-port all source patches onto 0.12.6; three are gone entirely:
moduleapi (the two vnc_muc_fcm modules call core.storagemanager
directly now), mod_admin_telnet and portmanager (replaced by
console_interfaces/http_interfaces config). The muc.lib fork keeps its
four functional changes including the externally consumed
muc-config-sub-mitted event; the operator-precedence hunk was fixed
upstream. mod_muc_mam shrinks to keep-archive-on-room-destroy since
muc_log_expires_after="never" disables cleanup upstream in 0.12.

Delete the bundled mod_smacks fork and the no-op mod_smacks_offline;
core 0.12 smacks supersedes them (options audited, dead smacks_max_old
corrected to smacks_max_old_sessions).

Config/startup: drop legacyauth, run_as_root, daemonize; bosh_ports ->
http_ports; cross_domain_* -> http_cors_override; randomize
component_secret at startup (env-overridable); export
log_slow_events_threshold fallback (latent render bug).

Found while smoke-testing: pin --idn-library=idn (0.12's ICU default
segfaults without ICU data in the image); http became a private
service in 0.12 so 5280 needs http_interfaces to stay public; the
telnet console now depends on mod_admin_socket, whose socket moves to
/var/log/prosody.

Verified: prosodyctl check config clean; boots against Postgres with
empty error log and same port bindings as 0.11; healthcheck green;
telnet console and SQL storage round-trip; 0.11->0.12 schema upgrade
rehearsed on a 0.11-created database with data intact.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Part-of: <http://gitlab.vnc.biz/uxf/vnctalk-prosody/-/merge_requests/3>
2026-07-15 17:58:02 +02:00
Stefan-Sanger d54d4076a3 fix: more debug output 2025-10-13 16:33:47 +02:00
Stefan-Sanger 8954d005d0 fix: debug REST send 2025-10-13 16:26:27 +02:00
Stefan-Sanger 935ea283d0 fix: fcm with anonymous 2025-06-10 09:57:59 +02:00
Stefan-Sanger e4e25cf241 fix: add s2s keepalive for default jitsi 2025-03-17 09:23:35 +01:00
Stefan-Sanger 78dfcc30d6 fix: silence logs 2023-09-07 10:57:10 +02:00
Stefan-Sanger 00f9b90eb7 fix: typo 2023-03-16 12:53:31 +01:00
Stefan-Sanger 91f42bfa7d fix: lang detection 2023-03-16 12:48:21 +01:00
Stefan-Sanger 402b3a03ff fix: debug info 2023-03-16 12:40:46 +01:00
Stefan-Sanger ba3195ac1f fix: typo 2023-03-16 12:32:21 +01:00
Stefan-Sanger 76f1721bf9 fix: log settings 2023-03-16 12:28:03 +01:00
Stefan-Sanger dea04a55fb fix: avoid accidential removal of remote session 2023-02-21 05:59:20 +01:00
Stefan-Sanger 3c8212fbf2 fix: more debug output 2023-02-20 18:06:03 +01:00
Stefan-Sanger dff8895ac4 fix: more debug output 2023-02-20 18:00:37 +01:00
Stefan-Sanger 9162ea81c4 fix: more debug output 2023-02-20 17:37:44 +01:00
Stefan-Sanger 9e7b2f469d fix: more debug output 2023-02-20 17:18:45 +01:00
Stefan-Sanger 290f749224 fix: debug iom activity 2023-02-20 17:08:24 +01:00
Stefan-Sanger 453ef67a53 fix: send read pushes from backend - 30003052-26340 2022-11-09 10:54:33 +01:00
Stefan-Sanger 7ffc9ce26f fix: log verbosity 2022-10-06 05:30:11 +02:00
Stefan-Sanger 638a5734ee fix: typo 2022-10-06 05:22:22 +02:00
Stefan-Sanger 284b29ac80 fix: log verbosity 2022-10-06 05:07:30 +02:00
Stefan-Sanger 945bc970c4 fix: more log cleanup 2022-09-29 11:50:16 +02:00
Stefan-Sanger 19f35d8bdb fix: log cleanup 2022-09-29 07:59:16 +02:00
Stefan-Sanger 4c8d19647f fix: payload for ios 2022-09-22 08:03:47 +02:00
Stefan-Sanger 434325a168 fix: more log cleanup 2022-09-22 05:42:39 +02:00
Stefan-Sanger 0e842026e6 fix: log cleanup 2022-09-22 05:32:33 +02:00
Stefan-Sanger 8f1f42fd38 fix: log cleanup 2022-09-15 08:50:33 +02:00
Stefan-Sanger 81d58608bf fix: debug output 2022-09-15 08:29:31 +02:00
Stefan-Sanger 94d16527f9 fix: logging 2022-09-15 08:13:00 +02:00
Stefan-Sanger 7601143bad fix: initial dockerbuild of current prosody for alpine 2022-09-05 06:50:25 +02:00