Skip to content

Unable to save Anonymous user #1230

Closed
Closed
@Jinoooo

Description

@Jinoooo

Setup parse-server on AWS, and passed the CRUD transactions successfully. In my app which is working with parse.com, i switched to my hosted parse-server and it fails when trying the save anonymous user. Even the simple query fails. See codes below:

Environment Setup


> iOS SDK: 1.12.0
> hosted on AWS with the following package.son file:

 {
  "name": "parse-server-example",
   "version": "1.3.0",
   "description": "An example Parse API server using the parse-server module",
   "main": "index.js",
   "repository": {
     "type": "git",
     "url": "https://github.com/ParsePlatform/parse-server-example"
   },
   "license": "MIT",
   "dependencies": {
     "express": "~4.11.x",
     "kerberos": "~0.0.x",
     "parse": "~1.6.12",
     "parse-server": "~2.1.6"
   },
   "scripts": {
     "start": "node index.js"
   },
   "engines": {
     "node": ">=4.3"
   }
 }

Steps to reproduce when saving current user

    // save the new anonymous user
    if ([PFUser currentUser].isDirty) {
        [[PFUser currentUser] saveInBackgroundWithBlock:^(BOOL succeeded, NSError *error) {
            if (error) {
                DLog(@"Anonymous login failed.");
            } else {
                DLog(@"Anonymous user logged in.");
            }
        }];

Logs/Trace

[AppDelegate syncWithCloud]_block_invoke [Line 681] Anonymous login failed.

Steps to reproduce when query a class

+ (void) queryEvents {
    DLog(@" *** QueryEvents started...");
    PFQuery *query = [PFQuery queryWithClassName:kParseClassEvent];
    [query orderByDescending:@"status,name"];
    query.limit = 500;  // By default, results are limited to 100, but anything from 1 to 1000 is a valid limit:
    query.cachePolicy = kPFCachePolicyNetworkElseCache;

    // Run the query
    [query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) {
        if (!error) {
            DLog(@"**** query results count: %lu", (unsigned long)objects.count);
            [[NSNotificationCenter defaultCenter] postNotificationName:kQueryEventsDidFinishNotification object:objects];
        }
        else { // something bad happened
            DLog(@"**** something bad happened %ld:%@", (long)error.code ,error.description);
            [[NSNotificationCenter defaultCenter] postNotificationName:KQueryEventsDidFailNotification object:error];
        }
    }];
    DLog(@" *** QueryEvents ended ...");
}

Logs/Trace

[ParseUtil queryEvents]_block_invoke [Line 262] **** something bad happened 120:Error Domain=Parse Code=120 "Cache miss." UserInfo={error=Cache miss., NSLocalizedDescription=Cache miss., code=120}

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