Closed DMRobertson closed 2 years ago
urlparse(endpoint).netloc
. It's a str
or bytes
depending on the type of endpoint
.endpoint
is device.data.get("endpoint")
.device
is a Device. device.data
is either None
or raw["data"]
raw
is a dict
coming from some json and so should contain strings rather than bytes.raw
by itself somewhere?Oh, I'm an idiot. Some of the earlier sentry events have the locals on them (most recent one didn't seem to parse somehow?)
endpoint_domain is b''
.
appId often seems to be hydrogen: io.element.hydrogen.web
- I'm assuming that
raw
is adict
coming from some json and so should contain strings rather than bytes.
notif["devices"]
in Notification
Notifications
get built via body = json_decoder.decode(request.content.read().decode("utf-8"))
-> Notification(body["notification"])
So I think I agree with you that this should be a string, not bytes.
Note that it seems that urlparse
has some magic in it though:
>>> from urllib.parse import urlparse
>>> urlparse(None)
ParseResultBytes(scheme=b'', netloc=b'', path=b'', params=b'', query=b'', fragment=b'')
This seems to match the data we're getting (endpoint == None
).
(I think in this case allowed
can be set to false directly?) @bwindels might have some other thoughts though.
Note that it seems that
urlparse
has some magic in it though:
That does match the type stub. So I guess for us to have detected this we'd need device.data
to be more strongly typed.
The spec says that data
is optional, but there's a note about http
pushers which suggests that data might be required for an http pusher? Can investigate more tomorrow.
The spec says that
data
is optional, but there's a note abouthttp
pushers which suggests that data might be required for an http pusher? Can investigate more tomorrow.
data
seems to exist OK though, I think the issue is the endpoint
key is missing in it.
data
seems to exist OK though, I think the issue is theendpoint
key is missing in it.
That seems like what's happening.
We have nowhere to deliver the notification if the pushkey is missing an endpoint
, so I'm going to make sygnal reject the pushkey.
First seen a month ago --- did we do some kind of release then?
Internal users: https://sentry.matrix.org/sentry/sygnal-matrixorg/issues/228100/?query=is%3Aunresolved
Need to understand:
regex
are we using and where did it come from