Skip to content

Retrieving related and pinned entities doesn't work #1810

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

Closed
4 tasks done
jcarloshorus opened this issue Mar 6, 2023 · 3 comments
Closed
4 tasks done

Retrieving related and pinned entities doesn't work #1810

jcarloshorus opened this issue Mar 6, 2023 · 3 comments
Labels
type:bug Impaired feature or lacking behavior that is likely assumed

Comments

@jcarloshorus
Copy link

jcarloshorus commented Mar 6, 2023

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

@parse-github-assistant
Copy link

parse-github-assistant bot commented Mar 6, 2023

Thanks for opening this issue!

  • 🚀 You can help us to fix this issue faster by opening a pull request with a failing test. See our Contribution Guide for how to make a pull request, or read our New Contributor's Guide if this is your first time contributing.

@mtrezza mtrezza added the type:bug Impaired feature or lacking behavior that is likely assumed label Mar 6, 2023
@dplewis
Copy link
Member

dplewis commented Aug 31, 2023

@mtrezza I believe this was fixed in #1662

@mtrezza
Copy link
Member

mtrezza commented Sep 1, 2023

Closing, @jcarloshorus if the issue exists after the fix mentioned above, please let us know and we can reopen.

@mtrezza mtrezza closed this as completed Sep 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Impaired feature or lacking behavior that is likely assumed
Projects
None yet
Development

No branches or pull requests

3 participants