Skip to content

Using PostgreSQL and Android, GeoPoints fields are null because it's __type isn't set to GeoPoint #3694

@dan-dr

Description

@dan-dr

Issue Description

Working on my Android app, when doing a fetchInBackgroundIfNeeded on one of my classes with a GeoPoint field, it returns with that field set to a HashMap instead of a GeoPoint. Looking at the JSON response I get from the server, it returns the field without __type: "GeoPoint".
Looking at Parse-Android-SDK - https://github.com/parse-community/Parse-SDK-Android/blob/ddf8de457bcdb588aa243339fbc42be54c0a1df5/Parse/src/main/java/com/parse/ParseDecoder.java#L113 it needs the typestring to be GeoPoint in order to create the ParseGeoPoint.
In turn this results in a Null exception when trying to get the GeoPoint using https://github.com/parse-community/Parse-SDK-Android/blob/a8c380dc4d959bbe345c85151ae83eece1b486b7/Parse/src/main/java/com/parse/ParseObject.java#L3392

Steps to reproduce

Use PostgreSQL Database. Make a simple get query to a class which has a GeoPoint field.

Expected Results

In the JSON, the GeoPoint field should have __type set to GeoPoint

Actual Outcome

The field only consists only of latitude and longitude fields

Environment Setup

  • Server

    • parse-server version (Be specific! Don't say 'latest'.) : 2.3.7
    • Operating System: Amazon Linux, Windows
    • Hardware: hmm nothing special
    • Localhost or remote server?: Both localhost and AWS,
  • Database

    • PostgreSQL version: 9.6.1, 9.4.1
    • Hardware: RDS t2.micro
    • Localhost or remote server? AWS

I edited the PostgresStorageAdapter.js here:

and added __type: "GeoPoint" and my Android app is working properly. i'll PR and I really hope it can be merged soon since Beanstalk is using npm to get dependencies.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions