cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
What’s new: end-to-end encryption, Replay and Dash updates. Find out more about these updates, new features and more here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Re: listDatastoreInfo.mtime can be nil

listDatastoreInfo.mtime can be nil

Caram
New member | Level 1

I have this issue where datastoreInfo.mtime is nil for some of my datastores. I would expect that it can never be nil. This is all the more curious that datastore.mtime is never nil for the same datastore. This makes the mtime attribute unrealiable to use.

I have had this issue for several months now but never got round to reporting it/examining it deeply.

Caram

(main)> store
=> #<DBDatastore:0x111ea5680>
(main)> store.mtime
=> 2015-02-14 22:20:08 +0100
(main)> store.manager.listDatastoreInfo(nil).select{ |id, info| info.mtime == nil }.values.first.mtime
=> nil

iOS 8.1.3
XCode 6.1
SDK 3.1.2

3 Replies 3

Greg-DB
Dropbox Staff

The mtime on both DBDatastore and DBDatastoreInfo can be nil, per the documentation:

https://www.dropbox.com/developers/datastore/docs/ios#DBDatastore.mtime :

The last modified time for this datastore, or nil if no data has been synced yet.

https://www.dropbox.com/developers/datastore/docs/ios#DBDatastoreInfo.mtime :

The last modified time for this datastore, or nil if none is set.

The fact that one is nil when the other isn't though is a little surprising. When does this happen exactly? Can you supply some sample code?

Also, are you sure you're looking at the same datastore in your output here? That is, store.mtime, is referring to a specific datastore, but store.manager.listDatastoreInfo(nil).select... seems to be looking for any DBDatastoreInfo where mtime is nil.

Caram
New member | Level 1

Greg, yeap they are the same datastores; I did check, even though did not report all the command lines here. Sorry no sample code but the entire app, difficult to know when and why it did occur, but the result is still visible today in some datastore.

Is there anything I could to to provide you with more information for this datastore?

I would suspect a datastore and listDatastoreInfoare not looking at the same data struture and for some reason, in some unfortunate corner case, the time attribute does not get copied across. But obviously I don't have the code to check this out. 😉

Greg-DB
Dropbox Staff

Thanks Caram. Some sample code and steps to reproduce this would be helpful. Also, sample output showing this happening with the same datastore, e.g., with a specific ID, may be useful.

Anyway, since both of these can be nil, is it possible you're somehow just catching this before it was propagated to both places? When is this happening? I.e., when are you catching it in the debugger (per your above output)?

Also, just to confirm, you are always looking at mtime and not "time", right? I just ask because you said "time" in your original question (which I fixed) but you did it again in this followup.

Need more support?