wultra/mtoken-sdk-ios

Consider empty check on push token

Closed this issue · 2 comments

Transfered from another project.

note: IF WE GONNA IMPLEMENT THIS, DUPLICATE THIS ISSUE TO ANDROID SDK!


I am not sure if this is iOS or Android (or maybe it is even just in the SDKs, and the issue is in app plugin) but we can see the following message in the log:

2021-02-11 07:33:31,636 [default task-6246] ERROR c.w.a.e.c.a.PushRegistrationController - Invalid request object in push registration - No push registration token was provided when registering for push messages., user ID: [REDACTED]
2021-02-11 07:33:31,637 [default task-6246] WARN  c.w.a.e.e.DefaultExceptionHandler - Error occurred when registering to push server.
com.wultra.app.enrollmentserver.errorhandling.InvalidRequestObjectException: null
	at com.wultra.app.enrollmentserver.controller.api.PushRegistrationController.registerDeviceImpl(PushRegistrationController.java:91)
	at com.wultra.app.enrollmentserver.controller.api.PushRegistrationController.registerDeviceToken(PushRegistrationController.java:73)
	at sun.reflect.GeneratedMethodAccessor75.invoke(Unknown Source)

This means that the value of push token was either null, or empty:

We should not call the push registration endpoint in the case push token is null for any reason.

My opinion is that I'm not sure it's a good idea to stop this on the client as this can be a good thing to see in server logs (in case that the client is complaining that the push notifications are not working).

Closing - we should not limit what can and cannot be inside the token itself.