mrDoctorWho / ejabberd_mod_apns

An ejabberd module to send PUSH messages to iOS devices through APNS
MIT License
33 stars 19 forks source link

Case clause on attempt to register with already registered jid, but different token #7

Closed alexsandbox closed 8 years ago

alexsandbox commented 8 years ago

First installed application works fine, push notifications work. After I removed and installed application again, there is a new token. in ejabberd log i have this:

14:40:09.879 [debug] _mod_apns: info_ test@flash.intellin.ru@ce22fd1a4fe21374ce61214b1b51717b8869ece49ad25e2e1eebe07fa52548f0
14:40:09.879 [error] {{case_clause,[{apns_users,{<<"test">>,<<"flash.intellin.ru">>},<<"b3f3a7a40c6e977fd0752e63fc3ee779ecf24f7b8e1b3b426791835f5423279d">>,1469532130}]},[{mod_apns,iq,3,[{file,"src/mod_apns.erl"},{line,130}]},{gen_iq_handler,process_iq,6,[{file,"src/gen_iq_handler.erl"},{line,128}]},{ejabberd_local,route,3,[{file,"src/ejabberd_local.erl"},{line,114}]},{ejabberd_router,route,3,[{file,"src/ejabberd_router.erl"},{line,77}]},{ejabberd_c2s,check_privacy_route,5,[{file,"src/ejabberd_c2s.erl"},{line,2130}]},{ejabberd_c2s,session_established2,2,[{file,"src/ejabberd_c2s.erl"},{line,1270}]},{p1_fsm,handle_msg,10,[{file,"src/p1_fsm.erl"},{line,582}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,247}]}]}

comment for log: _modapns: info - there are incoming user@server@token

If I understand, then erl can't writes in mnesia the row, it must updates the row.

So the clauses in code are identity

            %% Record exists, the key is equal to the one we know
    [#apns_users{user={LUser, LServer}, token=Token}] ->
            ...................
    %% Record for this key has been found, but for another key
    [#apns_users{user={LUser, LServer}, token=Token}] ->
vijayaa commented 8 years ago

which version of ejabberd use are using. i am using 16.02 . it is not sending push notification

mrDoctorWho commented 8 years ago

@vijayaa please don't write comments on in random issues

mrDoctorWho commented 8 years ago

@filos00f, so your token has changed and the module is unable to work with that change? Have I got you right?

I wonder why no one came up with such question yet.

alexsandbox commented 8 years ago

Yes, you are right. ejabberd ver16, I replaced xml -> fxml.

mrDoctorWho commented 8 years ago

@filos00f This is weird, because no one came up with this. I'll look up into this issue, thank you for the report.

mrDoctorWho commented 8 years ago

@vijayaa Sorry, I was on a bus and misread your comment. My bad.

mrDoctorWho commented 8 years ago

Hey @filos00f

Hope you still need this module because the fix's just arrived! Well, I hope it did.

alexsandbox commented 8 years ago

It works.