Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid Child left irreconciliable if Parent is synced successfully when using Parent/Children Sync Up Target #3275

Open
jpmonette opened this issue Sep 28, 2020 · 1 comment
Labels

Comments

@jpmonette
Copy link

Please fill out the following details:

  1. Version of Mobile SDK Used: 8.2.0
  2. Issue found in Native App or Hybrid App: React-Native
  3. OS Version: 10.15.5 (19F101)
  4. Device: Simulator (iPad)
  5. Steps to reproduce:

Currently have the following Parent/Children Sync Up in place:

{
  iOSImpl: "SFParentChildrenSyncUpTarget",
  createFieldlist: ["Id", "Name"],
  updateFieldlist: ["Id", "Name"],
  childrenCreateFieldlist: ["Id", "FirstName", "LastName", "AccountId"],
  childrenUpdateFieldlist: ["Id", "FirstName", "LastName", "AccountId"],
  parent: {
    idFieldName: "Id",
    sobjectType: "Account",
    modificationDateFieldName: "LastModifiedDate",
    soupName: "AccountTest",
  },
  relationshipType: "MASTER_DETAIL",
  type: "rest",
  modificationDateFieldName: "LastModifiedDate",
  children: {
    parentIdFieldName: "AccountId",
    idFieldName: "Id",
    sobjectType: "Contact",
    modificationDateFieldName: "LastModifiedDate",
    soupName: "ContactTest",
    sobjectTypePlural: "Contacts",
  },
  idFieldName: "Id",
}
  1. Insert locally a valid Account with Id = local_1
  2. Insert locally an invalid Contact with AccountId = local_1, but without a LastName
  3. Run SyncUp
  1. Actual behavior:

Account is created, but Contact isn't. This is okay, except that the Contact does not have its AccountId replace, which makes it impossible to reconciliate afterward to the parent Account.

Accounts:

[
  {
    "__local__": false,
    "_soupEntryId": 13,
    "__locally_deleted__": false,
    "Id": "0012R00002B3pkyQAB",
    "__locally_updated__": false,
    "__locally_created__": false,
    "_soupLastModifiedDate": 1601305456881,
    "Name": "Sample Account",
    "attributes": {
      "type": "Account"
    }
  }
]

Contacts:

[
  {
    "__last_error__": "[\n  {\n    \"message\" : \"Required fields are missing: [LastName]\",\n    \"fields\" : [\n      \"LastName\"\n    ],\n    \"errorCode\" : \"REQUIRED_FIELD_MISSING\"\n  }\n]",
    "__local__": true,
    "_soupEntryId": 9,
    "__locally_updated__": true,
    "__locally_deleted__": false,
    "AccountId": "local_1",
    "LastName": "Jack",
    "Id": "local_dummy_id",
    "_soupLastModifiedDate": 1601305589200,
    "attributes": {
      "type": "Contact"
    },
    "__locally_created__": true
  }
]
  1. Expected Behavior:

Contact should either have AccountId replaced from local_1 to 0012R00002B3pkyQAB after syncUp OR Account should not be created, leaving its ID value to local_1.

Accounts:

[
  {
    "__local__": false,
    "_soupEntryId": 13,
    "__locally_deleted__": false,
    "Id": "0012R00002B3pkyQAB",
    "__locally_updated__": false,
    "__locally_created__": false,
    "_soupLastModifiedDate": 1601305456881,
    "Name": "Sample Account",
    "attributes": {
      "type": "Account"
    }
  }
]

Contacts:

[
  {
    "__last_error__": "[\n  {\n    \"message\" : \"Required fields are missing: [LastName]\",\n    \"fields\" : [\n      \"LastName\"\n    ],\n    \"errorCode\" : \"REQUIRED_FIELD_MISSING\"\n  }\n]",
    "__local__": true,
    "_soupEntryId": 9,
    "__locally_updated__": true,
    "__locally_deleted__": false,
    "AccountId": "0012R00002B3pkyQAB",
    "LastName": "Jack",
    "Id": "local_dummy_id",
    "_soupLastModifiedDate": 1601305589200,
    "attributes": {
      "type": "Contact"
    },
    "__locally_created__": true
  }
]
  1. Error Log:

None

@wmathurin wmathurin added the bug label Sep 28, 2020
@wmathurin
Copy link
Contributor

Thanks for reporting this issue @jpmonette
We will take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants