element-hq / synapse

Synapse: Matrix homeserver written in Python/Twisted.
https://element-hq.github.io/synapse
GNU Affero General Public License v3.0
1.28k stars 156 forks source link

Symptom After app_services is configured on the server, the application cannot receive message events #17101

Closed yangjl114 closed 3 months ago

yangjl114 commented 5 months ago

Description

We want to get the message from the server side and send it using the new message push vendor, because there are some restrictions on the use of fcm. Now we configure app_services on the server side for application registration, but the application side cannot receive the message time from the server side 1 2 3

Steps to reproduce

I created the app_service_2.yaml configuration file on the server side and configured app_service_config_files in the homeserver.yaml file: - /data/app_service_2.yaml, docker container restarts The synapse service starts normally, but the application receives no message events, and the application_services_state table in the database does not contain any data

Homeserver

https://m.tjfydi.com/

Synapse Version

1.103.0

Installation Method

Docker (matrixdotorg/synapse)

Database

PostgreSQL single/state No migration/No backup restore

Workers

Single process

Platform

aws-ec2 /ubuntu 22.04.4 LTS 22.04 jammy
synapse runs with a docker deployment docker 26.0.0

Configuration

id: "IRC Bridge" url: "https://{domain}/--/app/events" as_token: "30c05ae90a248a4188e620216fa72e349803310ec83e2a77b34fe90be6081f46" hs_token: "312df522183efd404ec1cd22d2ffa4bbc76a8c1ccf541dd692eef281356bb74e" sender_localpart: "admin" # Will result in @_irc_bot:example.org namespaces: users: [] aliases: [] rooms: []

Relevant log output

No error log was reported

Anything else that would be useful to know?

No response

reivilibre commented 3 months ago

You don't really explain in detail what you're expecting to happen, but note from https://spec.matrix.org/v1.10/application-service-api/#pushing-events that the path at which events are sent is not exactly the same as the one you specify in url.

You also didn't mention inviting the admin user into your rooms, which under your configuration is required to listen for events. Either that, or you need add some user patterns to the users namespace.

Given this, I don't think this is a bug in Synapse. Please consider asking for support in #synapse:matrix.org or another room that is appropriate to Application Services. Thanks!