Skip to content
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

Incorrect response value for the metrics Brave.Today.UsageMonthly #30722

Closed
GeetaSarvadnya opened this issue May 31, 2023 · 8 comments
Closed

Comments

@GeetaSarvadnya
Copy link

Description

Found while testing #30154
Incorrect response value for the metrics Brave.Today.UsageMonthly

Steps to Reproduce

  1. Clean profile 1.53.x
  2. Enable Brave News via NTP (31st May)
  3. View brave news feeds via NTP
  4. Open brave://local-state file
  5. Confirmed that the metrics Brave.Today.UsageMonthly response value is 1 and the flag value is set to "true" as expected
  6. Close the browser
  7. Set the sys date ahead by one day (i.e 1st June 2023 in my case)
  8. Relaunch the browser
  9. Reload brave://local-state and look for the metrics Brave.Today.UsageMonthly
  10. The metrics Brave.Today.UsageMonthly response value is still 1 which is incorrect as 1st June I have not viewed any brave news feeds
    image

Actual result:

Incorrect response value for the metrics Brave.Today.UsageMonthly

Expected result:

the metrics Brave.Today.UsageMonthly should not be shown in June month as no news feeds are viewed in June month

Reproduces how often:

Easy

Brave version (brave://version info)

Brave 1.53.74 Chromium: 114.0.5735.53 (Official Build) beta (64-bit)
Revision c499d7ea22c8b2dba278465a5df7b86a8efa4e64-refs/branch-heads/5735@{#970}
OS Windows 10 Version 22H2 (Build 19045.2965)
## Version/Channel Information:
  • Can you reproduce this issue with the current release? NA
  • Can you reproduce this issue with the beta channel? Yes
  • Can you reproduce this issue with the nightly channel? Yes

Other Additional Information:

  • Does the issue resolve itself when disabling Brave Shields? NA
  • Does the issue resolve itself when disabling Brave Rewards? NA
  • Is the issue reproducible on the latest version of Chrome? NA

Miscellaneous Information:

cc: @brave/qa-team @DJAndries @mattmcalister

@DJAndries
Copy link
Collaborator

@GeetaSarvadnya did you ensure the sent flag was set to true before advancing the system time? Also I see that you have an NTP in your tabs. If that's a restored tab with a news session, then the metric will be recorded as expected.

@GeetaSarvadnya
Copy link
Author

did you ensure the sent flag was set to true before advancing the system time?

@DJAndries The sent flag value is "true" which is mentioned in the step 5 above.

Also I see that you have an NTP in your tabs. If that's a restored tab with a news session, then the metric will be recorded as expected.

@DJAndries Let me close the NTP before I advance the sys date and try again. Thanks!

@GeetaSarvadnya
Copy link
Author

@DJAndries I have closed the NTP before advancing the sys date, After advancing the sys date, the usagemonthly metrics value is still 1 looks like a bug

@GeetaSarvadnya
Copy link
Author

The issue is reproducible in Android as well hence adding OS/Android label

@GeetaSarvadnya GeetaSarvadnya added the OS/Android Fixes related to Android browser functionality label Jun 7, 2023
@DJAndries
Copy link
Collaborator

@GeetaSarvadnya I noticed that you're advancing the clock by one day. Please advance it by one calendar month instead

@GeetaSarvadnya
Copy link
Author

GeetaSarvadnya commented Jun 14, 2023

@DJAndries In the scebario above, If I set the sys date ahead by one day a month is changing (i.e May 31st->1st June) but there is only one day difference between the two month, so I though the monthly usage metrics should not be shown on the 1st June if I have NOT viewed brave news feeds on 1st June.

But, if the monthly usage metrics calculation is considering the calendar month then this issue is working as expected. e.g If I view brave news feeds today 14th June and confirmed monthly usage metrics response value is 1 and sent flag value is "true" then fwd the sys clock by one month (i.e 14th July), relaunch the browser will not show the monthly usage and daily usage metrics in brave://local-state file as expected.

@DJAndries
Copy link
Collaborator

@GeetaSarvadnya sorry, i just realized that you were testing at the end of the month, which should work...

I just followed your steps, but used the dates June 30 and July 1. The results were expected. Could you please re-test with these dates? again, sorry for the confusion

@GeetaSarvadnya
Copy link
Author

Viewed brave news on month end June 30th and fwd the sys clock by one day (i.e July 1st), relaunch the browser, shows the monthly usage response value as 1 .

June 30 July 1st
image (3) image (4)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants