You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This makes little sense, as you're expected to have a device if you're calling /sync. Much of the /sync handling code assumes you have a device, and would logically fail if the user didn't:
Passing device_id=None to this function always results in zero to-device messages being returned.
Is there anything holding us back (old access tokens?) from marking device IDs as str, not Optional[str]?
Edit: There are currently 64 entries in the access_tokens table on matrix.org that do not have an associated device ID. They are all either abuse, or go neb...
The text was updated successfully, but these errors were encountered:
This issue has been migrated from #11829.
I ran into this while implementing #11215.
Before matrix-org/synapse#949, it was possible to have access tokens that were not associated with a device. This has now been deprecated for 5 years.
This possibility has now crept across the codebase, as we've marked
device_id
asOptional
in many places, including:https://github.com/matrix-org/synapse/blob/d4e6f358b64b340a670e4f7496a530c11a715920/synapse/handlers/sync.py#L87-L93
This makes little sense, as you're expected to have a device if you're calling
/sync
. Much of the/sync
handling code assumes you have a device, and would logically fail if the user didn't:https://github.com/matrix-org/synapse/blob/3e0536cd2afb5a640619bd872fc27b068ec3eb9b/synapse/storage/databases/main/deviceinbox.py#L199-L201
Passing
device_id=None
to this function always results in zero to-device messages being returned.Is there anything holding us back (old access tokens?) from marking device IDs as
str
, notOptional[str]
?Edit: There are currently
64
entries in theaccess_tokens
table on matrix.org that do not have an associated device ID. They are all either abuse, or go neb...The text was updated successfully, but these errors were encountered: