Skip to content
This repository has been archived by the owner on Dec 22, 2023. It is now read-only.

NULL token saved to DB causing type error on send #33

Closed
rickmak opened this issue May 17, 2016 · 1 comment
Closed

NULL token saved to DB causing type error on send #33

rickmak opened this issue May 17, 2016 · 1 comment
Assignees
Milestone

Comments

@rickmak
Copy link
Member

rickmak commented May 17, 2016

For unknown reason, the a NULL token is saved to _device table. And causing type error on sending push notification.

  • Skygear Server Date/Version: v0.10
  • Application Platform: portal user

Expected Results

The NULL will got rejected during save time.

Actual Results

Got following error on calling push:users

{
  "error": {
    "name": "UnexpectedError",
    "code": 10000,
    "message": "panic occurred while handling request: sql: Scan error on column index 2: unsupported driver -> Scan pair: <nil> -> *string"
  }
}
@royuen royuen added the Planned label Jun 29, 2016
@royuen royuen modified the milestones: 0.13, 0.14 Jun 29, 2016
@royuen royuen added Focus and removed Planned labels Jul 12, 2016
@royuen royuen added Planned and removed Focus labels Jul 18, 2016
@cheungpat
Copy link
Contributor

It appears that skydb save skydb.Device with NULL token if the request’s device_token field is empty. This is explicitly done this way. There is also test case that explicitly test that the handler accepts device with empty token.

Therefore, my opinion is to keep existing behavior and not reject device with empty token.

cheungpat added a commit to cheungpat/skygear-server that referenced this issue Jul 21, 2016
If `device` table contains device with NULL token, Scan will complain
 that it is not able to scan a NULL value to a type of string.

refs SkygearIO#33
rickmak pushed a commit that referenced this issue Jul 21, 2016
If `device` table contains device with NULL token, Scan will complain
 that it is not able to scan a NULL value to a type of string.

refs #33
@rickmak rickmak closed this as completed Jul 21, 2016
@rickmak rickmak removed the In Review label Jul 21, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants