Skip to content

Problem updating array stored on local-datastore #127

Closed
@artemidius

Description

@artemidius

Please Help!

On every launch my app loads fresh data from parse.com and pins all objects to use app without network requests.

code:

public void pinKids() {
ParseQuery<ParseObject> query = ParseQuery.getQuery(ParseConstants.CLASS_KIDS);
    query.whereEqualTo(ParseConstants.KEY_PARENT, currentUser);
    query.findInBackground(new FindCallback<ParseObject>() {
        public void done(final List<ParseObject> kidsList, ParseException e) {
            if (e == null) {

                ParseObject.unpinAllInBackground(ParseConstants.LABEL_KIDS, new DeleteCallback() {
                    @Override
                    public void done(ParseException e) {
                        ParseObject.pinAllInBackground(ParseConstants.LABEL_KIDS, kidsList, new SaveCallback() {
                            @Override
                            public void done(ParseException e) {

                                Log.d("Hello", "pinKids");

                            }
                        });

                    }
                });

            }
        }
    });
}

One of the columns in my class is an array of strings (it stores history messages). I found that my code doesn't refresh this array if that array was updated from the other device (the same user did something on the other device). The rest of the data (other columns) refresh without problems. But the array of strings stays as it was downloaded at first launch.

In parse.com dashboard I see that array is updated. But code doesn't download this array while all the other columns are downloaded correctly.

Let me say that when I update this array on device-1 the new data is stored on device-1 and on "parse.com" too. But it doesn't update on device-2.

For example if you add item1 fom device-1. Array in parse-cloud contains
[ "item1" ]
If then you update array on device-2 with item2 and item3, Parse-array will contain
[ "item2" ,"item3" ]
And if then you'll use device-1 to add item4. Parse-cloud will contain
["item1", "item4" ]

I see that after query objects contain fresh data downloaded from parse-cloud. But array contains only old data that was pinned at first launch and updated locally. It means that query excludes array.

And all other columns (not arrays) update correctly.

For me it looks pretty like Bug.

I've already tried
http://stackoverflow.com/questions/32434968/android-parse-com-array-is-not-updating

and google groups
https://groups.google.com/forum/#!topic/parse-developers/YCUhpOfJees

With no result

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