• Peter Marshall's avatar
    Increase visibility into HatsService failures · bd4ea599
    Peter Marshall authored
    DevTools is intending to share Chrome's HaTS implementation, but we have
    a slightly different use-case as we are presenting 'persistent' surveys,
    which are triggered by user interaction like clicking a link to take a
    survey. These surveys are always triggered on the server-side, and don't
    have a client-side rate limit.
    
    DevTools' surveys will be triggered by the user clicking on a link. If
    we know that a survey won't succeed, we want to avoid showing the link
    in the first place. We've extended the HatsService API with
    CanShowSurvey() to indicate whether we already know a survey will fail.
    
    We also want to know whether a survey has failed to show to the user,
    even after the initial CanShowSurvey check, which is possible. To get a
    signal for this we've added success and failure callbacks to
    LaunchSurvey().
    
    As DevTools will use persistent, user-prompted surveys, we've added
    the notion of user-prompted to the SurveyConfig struct. This changes
    some survey triggering behavior:
     - We remove the minimum profile age check.
     - We remove the last started time for this survey check.
     - We remove the last started time for any survey check.
    
    We still trigger the UMA stats in CanShowSurvey(), even though they will
    be duplicated in LaunchSurvey. The reasoning is that the UMA stats are
    only recorded for 'failed' cases where CanShowSurvey() returns false -
    the expectation is that the caller will not then call LaunchSurvey and
    trigger a 2nd UMA stat which would potentially skew results.
    
    Doc: https://docs.google.com/document/d/1wMRb1hI2zJ1mzOSJjjF46C2hToGksQf2AxurorxaiTg
    
    Bug: 1112738
    Change-Id: Id48fb9296fbce898fc6428cd562990e25e96457b
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2485940
    Commit-Queue: Peter Marshall <petermarshall@chromium.org>
    Reviewed-by: default avatarTheodore Olsauskas-Warren <sauski@google.com>
    Reviewed-by: default avatarPeter Kasting <pkasting@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#822079}
    bd4ea599
hats_service.cc 21.5 KB