We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
Caram
11 years agoNew member | Level 1
listDatastoreInfo.mtime can be nil
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
Replies have been turned off for this discussion
- Greg-DB11 years ago
Dropbox Community Moderator
The
mtimeon bothDBDatastoreandDBDatastoreInfocan benil, 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
nilwhen 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, butstore.manager.listDatastoreInfo(nil).select... seems to be looking for anyDBDatastoreInfowheremtimeisnil. - Caram11 years agoNew 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
datastoreandlistDatastoreInfoare not looking at the same data struture and for some reason, in some unfortunate corner case, thetimeattribute does not get copied across. But obviously I don't have the code to check this out. ;-) - Greg-DB11 years ago
Dropbox Community Moderator
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
mtimeand 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.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!