-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ios doesn't fill in metadata timezone information for rw documents #17
Comments
Example
|
shankari
added a commit
to shankari/e-mission-server
that referenced
this issue
Jul 25, 2016
As described in e-mission/cordova-usercache#17, it looks like we never actually passed in a timezone from the client, which means that the code to check for timezone validity was never tested. And of course, that which is not tested is broken. Fix the check by adding appropriate imports and module names. With this change, we now store the incoming config ``` 2016-07-25 15:28:17,503:DEBUG:module_name = emission.net.usercache.formatters.ios.consent 2016-07-25 15:28:17,555:DEBUG:write_ts = 1469477974 2016-07-25 15:28:17,556:DEBUG:insert called 2016-07-25 15:28:17,556:DEBUG:entry was fine, no need to fix it 2016-07-25 15:28:17,557:DEBUG:Inserting entry AttrDict({u'user_id': UUID('0763de67-f61e-3f5d-90e7-518e69793954'), u'_id': ObjectId('57969202115514afcd79338b'), u'data': AttrDict({u'category': u'emSensorDataCollectionProtocol', u'approval_date': u'2016-07-14', u'protocol_id': u'2014-04-6267'}), u'metadata': AttrDict({u'platform': u'ios', 'write_local_dt': LocalDate({'hour': 13, 'month': 7, 'second': 34, 'weekday': 0, 'year': 2016, 'timezone': u'America/Los_Angeles', 'day': 25, 'minute': 19}), u'read_ts': 0, u'key': u'config/consent', u'plugin': u'none', u'write_ts': 1469477974, u'type': u'rw-document', u'time_zone': u'America/Los_Angeles', 'write_fmt_time': '2016-07-25T13:19:34-07:00'})}) into timeseries ``` and return it as a document. ``` 2016-07-25 15:28:45,014:DEBUG:finished querying values for ['config/consent'] 2016-07-25 15:28:45,014:DEBUG:finished querying values for [] 2016-07-25 15:28:45,015:DEBUG:Found 2 user overrides for user 0763de67-f61e-3f5d-90e7-518e69793954 2016-07-25 15:28:45,015:DEBUG:last entry is Entry({u'user_id': UUID('0763de67-f61e-3f5d-90e7-518e69793954'), u'_id': ObjectId('57969202115514afcd79338b'), u'data': {u'category': u'emSensorDataCollectionProtocol', u'approval_date': u'2016-07-14', u'protocol_id': u'2014-04-6267'}, u'metadata': {u'write_fmt_time': u'2016-07-25T13:19:34-07:00', u'write_ts': 1469477974, u'plugin': u'none', u'time_zone': u'America/Los_Angeles', u'platform': u'ios', u'write_local_dt': {u'hour': 13, u'month': 7, u'second': 34, u'weekday': 0, u'year': 2016, u'timezone': u'America/Los_Angeles', u'day': 25, u'minute': 19}, u'key': u'config/consent', u'read_ts': 0, u'type': u'rw-document'}}) 2016-07-25 15:28:45,015:DEBUG:for 0763de67-f61e-3f5d-90e7-518e69793954, config is Consentconfig({u'category': u'emSensorDataCollectionProtocol', u'approval_date': u'2016-07-14', u'protocol_id': u'2014-04-6267'}) 2016-07-25 15:28:45,016:DEBUG:Result = {'updatedExisting': False, u'nModified': 0, u'ok': 1, u'upserted': ObjectId('5796929d115514afcd793398'), u'n': 1} after updating document config/consent ```
android is fine:
but it looks like it works for iOS as well.
|
Actually, it looks like the metadata
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
While investigating documents created directly from javascript today, I discovered that iOS doesn't fill in metadata timezone information, at least for for rw documents. And since the metadata is consistent, it probably doesn't fill in the information for any documents.
We do workaround this by setting the timezone to
America/Los_Angeles
if it is not present, but that's incorrect for locations other than the west coast of the US. We should either stop using the metadata timezone, or fill it in correctly.The text was updated successfully, but these errors were encountered: