ReadUserData should not return all-or-nothing |
|||
Issue descriptionRight now ReadUserData either returns values for every key requested or none, if any cannot be found: https://cs.chromium.org/chromium/src/content/browser/service_worker/service_worker_database.h?sq=package:chromium&rcl=1478435172&l=181 This means we end up re-querying for sender id here: https://cs.chromium.org/chromium/src/content/browser/push_messaging/push_messaging_message_filter.cc?q=push_messaging_me&sq=package:chromium&l=323 The result is code that is not immediately understandable - it is necessary to go and look up the fact that ReadUserData is all-or-nothing to check the right thing is happening. If ReadUserData was not all or nothing, but instead returned whatever exists, then it would be obvious what's going on, and would avoid checking twice for the same data. Other call-sites may require more checks of the return values = if necessary an 'allOrNothing' flag could be added for their convenience. The question now becomes what status to return if only some keys exist, and what to return in place of values that do not exist. Is the empty string sufficient?
,
Jan 15 2018
It appears that the code has changed since this bug was first filed. For instance, I can't find the second file from Comment 1: https://cs.chromium.org/chromium/src/content/browser/push_messaging/push_messaging_message_filter.cc?q=push_messaging_me&sq=package:chromium&l=323 Also, the fact that this has been sitting in our queue for over a year might indicate it's no longer relevant. I have a suspicion this logic has been migrated to Mojo. Assigning to Anita to re-evaluate. Anita, feel free to assign to me if this is a low priority code cleanup and I can help. Thanks.
,
Jan 15 2018
The code has shifted but we still requery for the sender id from the PushMessagingManager, here: https://cs.chromium.org/chromium/src/content/browser/push_messaging/push_messaging_manager.cc?l=400 That said, I think this can be closed as WontFix, it's only piece of code which would benefit and plenty more that would need to be fixed up, so in balance this ain't worth it given competing priorities.
,
Jan 15 2018
*only 1 piece of code |
|||
►
Sign in to add a comment |
|||
Comment 1 by sheriffbot@chromium.org
, Nov 8 2017Status: Untriaged (was: Available)