Open tmolitor-stud-tu opened 6 years ago
Small addition: the token value used for registration looks like a python3 bytestring casted to string without proper encoding/decoding (the value was changed due to privacy reasons):
<value>b'a500a8519aca3cf94877bab0f340aa2205f5a840'</value>
Thanks for the report! Looks like some issues slipped through during the Python 3 migration...
@tmolitor-stud-tu Alright, the Python 3 string issue is now fixed on production. My guess is that it didn't really affect much because the tokens are just opaque strings anyway.
The tokens your XMPP server sees are not APNS tokens, but random tokens generated by the ChatSecure Push API server. They expire after 30 days so they must be rotated over time, but you shouldn't be seeing such a large number of registrations unless there is a bug in the client refresh logic.
@chrisballinger Well, a token rotation shouldn't change the node id, am I right? And only a changed node ID will register a new device in prosody's push implementation (and in ejabberd, too, I guess)
Much of the load on your push server is probably coming from this double and triple registrations.
I sent you my debug log (the xml sent by ChatSecure) via mail. Maybe it helps tackling down this issue.
Thanks, I'll take a look
Did you manage to take a look at my mail? If you need some help or more information go ahead and just ask for it. I'm happy to help if I can :)
ejabberd spit this out today:
[error] <0.320.0>@ejabberd_sql:check_error:1138 SQL query 'Q21699820' at {mod_push_sql,59} failed: [{severity,'ERROR'},{86,<<"ERROR">>},{code,<<"23505">>},{message,<<"duplicate key value violates unique constraint \"push_session_pkey\"">>},{detail,<<"Key (server_host, username, \"timestamp\")=(domain.tld, username, 1540741783202646) already exists.">>},{115,<<"public">>},{116,<<"push_session">>},{110,<<"push_session_pkey">>},{file,<<"nbtinsert.c">>},{line,433},{routine,<<"_bt_check_unique">>}]
[error] <0.6513.0>@mod_push:enable:312 Cannot enable push for username@domain.tld/chatsecure28173: database error
ChatSecure 4.3.5, newly installed app on new device, existing account
/LE: not sure if this is a sign: https://github.com/ChatSecure/ChatSecure-iOS/issues/883#issuecomment-433729470
A friend of mine installed the newest version of Chatsecure from iTunes today and after only a few hours I got 5 different devices registered for push on my private server out of a total of 17 push enable iqs. And no, she didn't reinstall the app at all and she didn't configure the account multiple times, too.
I can send you the IQs along with timestamps for debugging purposes but I don't want to post them here due to privacy reasons.
My guess is, that the device ID offered by apple is not stable at all (contrary to what is explained in their API documentation). This could be related to the roughly the same problem Monal has over here: https://github.com/tmolitor-stud-tu/mod_push_appserver/issues/6#issuecomment-391176730