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

Multi-Save incompatiable schema error #140

Closed
akiroz opened this issue Sep 15, 2016 · 4 comments
Closed

Multi-Save incompatiable schema error #140

akiroz opened this issue Sep 15, 2016 · 4 comments
Assignees
Labels

Comments

@akiroz
Copy link

akiroz commented Sep 15, 2016

Incorrect error object in SDK-JS multiple record save operation.

  • Skygear Server Date/Version: Skygear Cloud (Sep 15, 2016)
  • Application Platform: SDK-JS / Chromium

Expected Results

{
  status: 409
  error: {
    code: 114
    message: "failed to migrate record schema"
    name: "IncompatibleSchema"
  }
}

Actual Results

{
  _id: "person/d0bcbb3a-c379-460a-9dba-1f46eb980df1"
  _type: "error"
  code: 10000
  name: "UnexpectedError"
  message: "pq: invalid input syntax for type double precision: \"2016-09-15T07:21:15.851Z\""
}

Steps to reproduce

  • create schema by saving record:
{
_id: "605a5375-f617-4593-b418-1aa60ecaffe8"
_recordType: "person"
name: "frederica"
age: 19
height: 164
}
  • save record with incompatible type schema (changed age to Date object)
{
_id: "605a5375-f617-4593-b418-1aa60ecaffe8"
_recordType: "person"
ownerID: "7888d764-a20a-4c2c-89c2-8eb02de0a079"
createdAt: Thu Sep 15 2016 15:20:34 GMT+0800 (HKT)
createdBy: "7888d764-a20a-4c2c-89c2-8eb02de0a079"
updatedAt: Thu Sep 15 2016 15:20:34 GMT+0800 (HKT)
updatedBy: "7888d764-a20a-4c2c-89c2-8eb02de0a079"
name: "frederica"
age: Thu Sep 15 2016 15:21:15 GMT+0800 (HKT)
height: 164
}
  • see error object in the errors array
@cheungpat
Copy link
Contributor

@akiroz need your schema information and your request payload

@akiroz
Copy link
Author

akiroz commented Sep 15, 2016

@cheungpat updated.

@cheungpat
Copy link
Contributor

only happening if there are multiple records to save or it also happens when saving single record?

@akiroz
Copy link
Author

akiroz commented Oct 1, 2016

only multi-record save.

cheungpat added a commit to cheungpat/skygear-server that referenced this issue Oct 27, 2016
This only happens when saving multiple records with a
schema-incompatible record being latter than schema-compatible ones.

refs SkygearIO#140
@cheungpat cheungpat self-assigned this Oct 27, 2016
rickmak pushed a commit that referenced this issue Oct 28, 2016
This only happens when saving multiple records with a
schema-incompatible record being latter than schema-compatible ones.

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

No branches or pull requests

3 participants