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

Query.Include(key) does not fetch related object #1067

Open
phath9 opened this issue Oct 9, 2020 · 0 comments
Open

Query.Include(key) does not fetch related object #1067

phath9 opened this issue Oct 9, 2020 · 0 comments
Labels
type:bug Impaired feature or lacking behavior that is likely assumed

Comments

@phath9
Copy link

phath9 commented Oct 9, 2020

I'm making a Live Query subscription when a new message is created. Problem is parseQuery.include("sender") is not working as intended. Therefore, print(sender.getString("username")!!) fires an error because username field does not exist.

        val parseQuery = ParseQuery.getQuery<ParseObject>("messages")
        parseQuery.include("sender")

        val subscriptionHandling: SubscriptionHandling<ParseObject> = app.parseLiveQueryClient!!.subscribe(parseQuery)
        subscriptionHandling.handleEvent(SubscriptionHandling.Event.CREATE) { query, `object` ->
            val handler = Handler(Looper.getMainLooper())
            handler.post {
                val message = `object` as ParseObject
                val sender = `object`.getParseObject("sender") as ParseUser
                print(sender.getString("username")!!)
            }
        }

My Messages class has 'sender' as a Pointer to _User's objectId.

@mtrezza mtrezza added state:needs-investigation type:bug Impaired feature or lacking behavior that is likely assumed labels Oct 9, 2021
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

2 participants