[Pushwoosh Plugin] RegisterToken Error when user is not logged in

[Pushwoosh Plugin] RegisterToken Error when user is not logged in

  
Forge Component
(5)
Published on 14 Jul by OutSystems R&D
5 votes
Published on 14 Jul by OutSystems R&D

Hi Team


When user is not logged in, RegisterToken in PushNotificationAPI will cause following error.

Error in advanced query UpdateDevice in RegisterToken in PushNotificationsApi (UPDATE {Device}  SET {Device}.[UserId] = @UserId, {Device}.[PushToken] = @PushToken,  {Device}.[DeviceTypeId] = @DeviceTypeId, {Device}.[UpdatedOn] = @UpdatedOn  WHERE {Device}.[HardwareId] = @HardwareId AND {Device}.[ApplicationCode] = @ApplicationCode): ORA-02291: integrity constraint (OSADMIN_DEV1.OSFRK_OSUSR_U2J_DEVICE_OS72191) violated - parent key not found


It seems UpdateDevice query set  UserId to 0, but it should be NULL.

We had  modified the query as following and it worked.

SET {Device}.[UserId] = CASE WHEN @UserId = 0 THEN NULL ELSE @UserId END, 


Regards

Wei

Hey, Wei,

Thanks for the heads-up (and fix)! We'll put it on the backlog to be added in the near future.

Thanks again,

Carlos Simões