question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Weekly usage is showing up incorrect response when a week overlaps two months

See original GitHub issue

Description

Found while testing https://github.com/brave/brave-browser/issues/18254 Weekly usage is showing up incorrect response when a week overlaps two months

Steps to Reproduce

  1. Set the system date to 29th Nov
  2. Create a wallet
  3. Open brave://local-state and confirmed Daily/weekly/monthly metrics response value is 1 as expected
  4. Close brave
  5. Set the system date 1st Dec
  6. Relaunch brave and verify brave://local-state
  7. Brave.Wallet.UsageWeekly response value is 0 instead of 1 - weekly usage stats collection starts from Monday, here 29th Nov is Mon and 1st Dec is Wed hence the weekly usage calculation should happen from 29th Nov to 5th Dec. So, I am expecting weekly usage as 1 but it’s showing up zero.

Actual result:

Weekly usage is showing up incorrect response when a week overlaps two months

Expected result:

Weekly usage value should be 1

Reproduces how often:

Easy

Brave version (brave://version info)

<html> <body>
Brave 1.33.83 Chromium: 96.0.4664.45 (Official Build) beta (64-bit)
Revision 76e4c1bb2ab4671b8beba3444e61c0f17584b2fc-refs/branch-heads/4664@{#947}
OS Windows 10 Version 21H1 (Build 19043.1348)
</body> </html> ## Version/Channel Information:
  • Can you reproduce this issue with the current release? Yes
  • 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/legacy_qa @mattmcalister @rillian @porteron

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
bbondycommented, Nov 23, 2021

Yes but DAU and MAU are more important to us so I’d be ok with a low priority on this and it sitting for a while.

0reactions
srirambvcommented, Nov 30, 2021

@rillian, shouldn’t all 3 values be set to 1 for the above?

Daily should be set to 1 as wallet is accessed on a new day (Dec 1st) Weekly should be set to 1 as wallet is access on the same week where two months overlap Monthly should also be set to 1 as the wallet is accessed on the 1st day of the month.

I tried the following scenario and the values don’t update accordingly

  • Set date to Nov 29
  • Enable CW flag and create an account (account login changes all values to be set to 1)
  • Close browser
  • Set date/time to Nov 30 11:59 PM
  • Wait for the day/time roll over
  • Launch browser
  • Values for all 3 (daily/weekly/monthly) are set to 0 and doesn’t update to 1

The above scenario only happened for CW and not for Brave Wallet

Read more comments on GitHub >

github_iconTop Results From Across the Web

Count days in each month for week overlapping two months
Save this question. Show activity on this post. If I had a sequence of weeks, does anyone know of a way to count...
Read more >
one week occurs in two months - how to handle this... - 955470
one week occurs in two months - how to handle this? Hi. I am getting strange answers when calculating monthly and weekly values...
Read more >
Calculating Gaps Between Overlapping Time Intervals in SQL
Login and logout times will be staggered, and so the intervals when users are logged in will be overlapping. Today we'll ultimately be...
Read more >
Handle Weeks that Overlap Years in a SQL Server Date ...
After determining the week number of a particular date, we can use a simple BETWEEN in our WHERE clause to filter the date...
Read more >
COMMON ERRORS IN KRONOS AND HOW TO FIX THEM
Correct: Kronos automatically calculated the 2 hours of overtime as CTO (comp time overtime). ... they would be incorrectly reporting 42 hours for...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found