CosmicMind / Graph

Graph is a semantic database that is used to create data-driven applications.
http://cosmicmind.com
MIT License
873 stars 72 forks source link

iCloud feature doesn't works for new projects #127

Closed swiftsrl closed 7 years ago

swiftsrl commented 7 years ago

Just make a new project, turn on iCloud, make an instance of Graph using the cloud init (where is not clear the purpose of the string you have to pass), make a new record and save the db, and finally setup a search, run it and you'll see the returned array is always empty

daniel-jonathan commented 7 years ago

I think this might be an issue because of the version of iOS that is being used. Are you using 10.2 when you build a new project?

swiftsrl commented 7 years ago

yes 10.2

daniel-jonathan commented 7 years ago

Okay, I will make a new project and see what the issue is, and if there is one, I will fix it right away :) Thanks for sharing this.

swiftsrl commented 7 years ago

hello Daniel news about that?

daniel-jonathan commented 7 years ago

Yes, sorry. I was caught up in some other issues. I will take a look at this today, and aim to have an update by the end of the week, if not earlier. Thank you!

daniel-jonathan commented 7 years ago

Hey, so I have tested this out again and all seems to work. I am not sure what if going on with your project. Can you verify in any way that iCloud is working for you?

I am currently able to sync data between my iPhone 6s and iPad Pro using 10.2.1.

swiftsrl commented 7 years ago

here are the steps:

daniel-jonathan commented 7 years ago

Are you doing these steps after the graphDidPrepareCloudStorage call?

swiftsrl commented 7 years ago

yes, just tried this:

func graphDidPrepareCloudStorage(graph: Graph) {
        debugPrint("graphDidPrepareCloudStorage")

        self.addName("Apple")
        self.addName("Google")

    }

the func:

func addName(_ name:String) {

        let record = Entity(type: "Names")
        record["name"] = name        
        db.sync()

        let search = Search<Entity>(graph: self.db).for(types: ["Names"])
        self.storage = search.sync(completion: nil)
        self.lc?.tableView.reloadData()

    }

but the search result is always empty....

daniel-jonathan commented 7 years ago

Okay, the best bet is to send me a sample with it not working, or what you have, and then I can test it. I need to see what is happening here. Thank you!

swiftsrl commented 7 years ago

ok, this is the test GraphCloudTest.zip

daniel-jonathan commented 7 years ago

Thank you, I will look at this in a few hours :)

swiftsrl commented 7 years ago

Thanks to one of my students I found the bug:

daniel-jonathan commented 7 years ago

Yes, that is correct. Because the Entity doesn't know which Graph you are referencing and without it specified, it goes to the default local Graph. Sorry, I didn't catch this earlier.