esl / MongooseIM

MongooseIM is Erlang Solutions' robust, scalable and efficient XMPP server, aimed at large installations. Specifically designed for enterprise purposes, it is fault-tolerant and can utilise the resources of multiple clustered machines.
Other
1.64k stars 420 forks source link

Messages send through push notifications again resended to the client upon reconnection #4233

Closed alvinlal closed 1 month ago

alvinlal commented 2 months ago

MongooseIM version: 6.1.1 Installed from: pkg Erlang/OTP version: 26

Messages send through push notifications are again resended to the client upon reconnection. This problem is solved when mod_offline is disabled . but when mod_offline is disabled, message receipts such as delivered receipt and read receipts are not stored offline when the recipient is offline and such receipts are missed and lost.

here is my config 👇

[general]
  loglevel = "all"
  hosts = ["xyz.example.com","localhost"]
  host_types = []
  default_server_domain = "localhost"
  registration_timeout = "infinity"
  language = "en"
  max_fsm_queue = 1000

[[listen.http]]
  port = 5280
  transport.num_acceptors = 10
  transport.max_connections = 1024

  [[listen.http.handlers.mod_bosh]]
    host = "_"
    path = "/http-bind"

  [[listen.http.handlers.mod_websockets]]
    host = "_"
    path = "/ws-xmpp"
    #timeout = 40_000
    #ping_rate = 30_000
    c2s_state_timeout = "infinity"

[[listen.http]]
  port = 5285
  transport.num_acceptors = 10
  transport.max_connections = 1024
  tls.verify_mode = "none"
  tls.certfile = "/etc/letsencrypt/live/xyz.example.com/fullchain.pem"
  tls.keyfile = "/etc/letsencrypt/live/xyz.example.com/privkey.pem"
  #tls.ciphers = "ECDHE_RSA_WITH_AES_128_GCM_SHA256"
  #tls.ciphers = "AES_256_GCM_SHA256"
  #tls.versions = ["tlsv1.2", "tlsv1.3"]
  #tls.password = ""

  [[listen.http.handlers.mod_bosh]]
    host = "_"
    path = "/http-bind"

  [[listen.http.handlers.mod_websockets]]
    host = "_"
    path = "/ws-xmpp"
    #ping_rate = 30_000
    c2s_state_timeout = "infinity"

[[listen.http]]
  ip_address = "0.0.0.0"
  port = 8088
  transport.num_acceptors = 10
  transport.max_connections = 1024

  [[listen.http.handlers.mongoose_admin_api]]
    host = "_"
    path = "/api"
    username = "admin"
    password = "secret"

[[listen.http]]
  port = 8089
  transport.num_acceptors = 10
  transport.max_connections = 1024
  protocol.compress = true
  tls.verify_mode = "none"
  tls.certfile = "priv/ssl/fake_cert.pem"
  tls.keyfile = "priv/ssl/fake_key.pem"
  tls.password = ""

  [[listen.http.handlers.mongoose_client_api]]
    host = "_"
    path = "/api"

[[listen.http]]
  ip_address = "127.0.0.1"
  port = 5551
  transport.num_acceptors = 10
  transport.max_connections = 1024

  [[listen.http.handlers.mongoose_graphql_handler]]
    host = "localhost"
    path = "/api/graphql"
    schema_endpoint = "admin"
    username = "admin"
    password = "secret"

[[listen.http]]
  ip_address = "0.0.0.0"
  port = 5541
  transport.num_acceptors = 10
  transport.max_connections = 1024

  [[listen.http.handlers.mongoose_graphql_handler]]
    host = "_"
    path = "/api/graphql"
    schema_endpoint = "domain_admin"

[[listen.http]]
  ip_address = "0.0.0.0"
  port = 5561
  transport.num_acceptors = 10
  transport.max_connections = 1024

  [[listen.http.handlers.mongoose_graphql_handler]]
    host = "_"
    path = "/api/graphql"
    schema_endpoint = "user"

[[listen.c2s]]
  port = 5222
  access = "c2s"
  shaper = "c2s_shaper"
  max_stanza_size = 65536
  tls.verify_mode = "none"
  tls.certfile = "priv/ssl/fake_server.pem"

[[listen.s2s]]
  port = 5269
  shaper = "s2s_shaper"
  max_stanza_size = 131072

[[listen.service]]
  port = 8888
  access = "all"
  shaper_rule = "fast"
  ip_address = "127.0.0.1"
  password = "secret"

[auth]
  methods = ["rdbms"]

  [auth.rdbms]

[outgoing_pools.rdbms.default]
  scope = "global"
  workers = 5

  [outgoing_pools.rdbms.default.connection]
    driver = "mysql"
    host = "localhost"
    database = "mongooseim"
    username = "root"
    password = "password"

[outgoing_pools.http.mongoose_push_http]
  scope = "global"
  strategy = "available_worker"

  [outgoing_pools.http.mongoose_push_http.connection]
    host = "https://localhost:8443"
    tls.verify_mode = "none"

[services.service_admin_extra]

[services.service_mongoose_system_metrics]

[modules.mod_ping]
  send_pings = true
  ping_interval = 15
  ping_req_timeout = 10
  timeout_action = "kill"

[modules.mod_offline]
  access_max_user_messages = "max_user_offline_messages"
  backend = "mnesia"

#[modules.mod_offline_stub]

[modules.mod_pubsub]
  plugins = ["push"] # mandatory minimal config

[modules.mod_event_pusher.push]
  backend = "rdbms" # optional
  wpool.workers = 200 # optional
  plugin_module = "mod_event_pusher_push_plugin_enhanced" # optional
  virtual_pubsub_hosts = ["pubsub.@HOST@"]

[modules.mod_push_service_mongoosepush]
  pool_name = "mongoose_push_http"
  api_version = "v3"

[modules.mod_adhoc]

[modules.mod_disco]
  extra_domains = ["xyz.example.com"]
  users_can_see_hidden_services = false

[modules.mod_stream_management]
  ack_freq = 1
  buffer_max = 100
  resume_timeout = 10

[modules.mod_roster]

[modules.mod_register]
  ip_access = [
    {address = "127.0.0.0/8", policy = "allow"},
    {address = "0.0.0.0/0", policy = "deny"}
  ]
  access = "register"

[modules.mod_presence]

[modules.mod_sic]

[modules.mod_vcard]
  host = "vjud.@HOST@"

[modules.mod_bosh]

[modules.mod_carboncopy]

[shaper.normal]
  max_rate = 1000

[shaper.fast]
  max_rate = 50_000

[shaper.mam_shaper]
  max_rate = 1

[shaper.mam_global_shaper]
  max_rate = 1000

[acl]
  local = [{}]

[access]
  max_user_sessions = [
    {acl = "all", value = 10}
  ]

  max_user_offline_messages = [
    {acl = "admin", value = 5000},
    {acl = "all", value = 100}
  ]

  local = [
    {acl = "local", value = "allow"}
  ]

  c2s = [
    {acl = "blocked", value = "deny"},
    {acl = "all", value = "allow"}
  ]

  c2s_shaper = [
    {acl = "admin", value = "none"},
    {acl = "all", value = "normal"}
  ]

  s2s_shaper = [
    {acl = "all", value = "fast"}
  ]

  muc_admin = [
    {acl = "admin", value = "allow"}
  ]

  muc_create = [
    {acl = "local", value = "allow"}
  ]

  muc = [
    {acl = "all", value = "allow"}
  ]

  register = [
    {acl = "all", value = "allow"}
  ]

  mam_set_prefs = [
    {acl = "all", value = "default"}
  ]

  mam_get_prefs = [
    {acl = "all", value = "default"}
  ]

  mam_lookup_messages = [
    {acl = "all", value = "default"}
  ]

  mam_set_prefs_shaper = [
    {acl = "all", value = "mam_shaper"}
  ]

  mam_get_prefs_shaper = [
    {acl = "all", value = "mam_shaper"}
  ]

  mam_lookup_messages_shaper = [
    {acl = "all", value = "mam_shaper"}
  ]

  mam_set_prefs_global_shaper = [
    {acl = "all", value = "mam_global_shaper"}
  ]

  mam_get_prefs_global_shaper = [
    {acl = "all", value = "mam_global_shaper"}
  ]

  mam_lookup_messages_global_shaper = [
    {acl = "all", value = "mam_global_shaper"}
  ]

[s2s]
  use_starttls = "optional"
  certfile = "priv/ssl/fake_server.pem"
  default_policy = "deny"
  outgoing.port = 5269

#[[host_config]]
#  host = "anonymous.localhost"
#
#  [host_config.auth.anonymous]
#    allow_multiple_connections = true
#    protocol = "both"
JanuszJakubiec commented 1 month ago

Could you provide more details? I would suggest logs from MongooseIM, and the stanzas that you've sent.

JanuszJakubiec commented 1 month ago

I'm closing the issue due to inactivity