Skip to content

Retrieving related and pinned entities doesn't work #1810

Closed
@jcarloshorus

Description

@jcarloshorus

New Issue Checklist

Issue Description

After pin objects following the steps #1118, i try recovery objects using Parse.Query and fetchFromLocalDatastore() and get the error 'Error: Cannot create a pointer to an unsaved ParseObject'. If you refresh the browser and do the same you'll get the error 'Error:Uncaught (in promise): TypeError: object._getId is not a function'.

Steps to reproduce

async recovery() {
    const qry  =  new Query(ClassB).fromLocalDatastore()
    const objs = await qry.find()
    for (const o of objs) {
      const obj = await o.fetchFromLocalDatastore()
      console.log(obj)
    }
  }

Actual Outcome

The instance of ClassB cannot be retrieved with all of it's attributes using the fetchFromLocalDataStore() with the error 'Cannot create a pointer to an unsaved ParseObject'. If you refresh the browser and do the same you'll get the error 'Uncaught (in promise): TypeError: object._getId is not a function'.

Expected Outcome

The recovered object instance of ClassB should be retrieved with all of the saved attributes and it's pointer to ClassA points to the local instance of ClassA.

Environment

Server

  • Parse Server version: 5.4.2
  • Operating system: Docker Linux Alpine
  • Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc): Google Cloud

Database

  • System (MongoDB or Postgres): Postgres
  • Database version: 13
  • Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc): Google Cloud

Client

  • Parse JS SDK version: 4.01, 4.1.0, alpha

Logs

ERROR Error:Uncaught (in promise): TypeError: object._getId is not a function

ERROR Error: "Uncaught (in promise): Error: Cannot create a pointer to an unsaved ParseObject

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:bugImpaired feature or lacking behavior that is likely assumed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions