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

Log important events in db #10781

Closed
10 tasks done
NejcZdovc opened this issue Jul 17, 2020 · 1 comment · Fixed by brave/brave-core#6383
Closed
10 tasks done

Log important events in db #10781

NejcZdovc opened this issue Jul 17, 2020 · 1 comment · Fixed by brave/brave-core#6383

Comments

@NejcZdovc
Copy link
Contributor

NejcZdovc commented Jul 17, 2020

Right now users tells us that something happen, but we don't if this is because we have a bug or user did some actions that triggers this at some point

To address this we should start logging important events in db so that we can see that for example user turned AC ON at time X and AC was then triggered at time Y.

We should create new table event_log, which would have fields:

  • event_id string (guid)
  • name string
  • value string
  • created_at timestamp

Things to log:

  • all state changes (so every time that we change state value; state = preference). Skip:
    • full recovery seed (just save first two bytes as sum)
    • external wallet
    • parameters
  • ac triggered
  • uphold wallet connected
  • uphold wallet status changed to verified
  • uphold wallet disconnected
  • recurring contribution added
  • recurring contribution removed
  • db migrated to new version
  • state migrated to new version
  • ad grants transfered

This should also be displayed on internals page.

@LaurenWags
Copy link
Member

LaurenWags commented Aug 28, 2020

Verified passed with

Brave	1.14.67 Chromium: 85.0.4183.83 (Official Build) dev (64-bit)
Revision	94abc2237ae0c9a4cb5f035431c8adfb94324633-refs/branch-heads/4183@{#1658}
OS	macOS Version 10.14.6 (Build 18G3020)

Verified test plan from brave/brave-core#6383

  • Confirmed on Event logs tab of brave://rewards-internals there was an entry for ac.enabled set to 1 initially
  • After toggling AC off and refreshing brave://rewards-internals, confirmed there was a new entry for ac.enabled which was now set to 0
  • Compared to Preferences file to confirm this file reflects that AC is not enabled also
  • Confirmed AC setting is retained on browser restart

eventlogss1

eventlogss2

Additional tests done:

  • Spot checked values from Event logs tab on brave://rewards-internals in comparison against the Preferences file to confirm they matched
  • Modified each of the following items individually and confirmed a new entry was added to the Event logs tab of brave://rewards-internals for each one:
    • changed Monthly Payment value in Auto-Contribute pane
    • changed Monthly Payment value in Auto-Contribute settings
    • changed Minimum page time before logging a visit
    • changed Minimum visits for publisher relevancy
    • unchecked/checked Show non-verified sites in list
    • unchecked/checked Allow contribution to videos
    • removed recurring tip from Monthly Contributions pane
    • unchecked/checked Reddit in Tips settings
    • unchecked/checked Twitter in Tips settings
    • unchecked/checked GitHub in Tips settings
    • restored a wallet (multiple new entries on Event logs tab of brave://rewards-internals for this)
    • claimed Ad grant, connected KYC'd uphold account, confirmed Ad grant moved to Uphold (multiple new entries on Event logs tab of brave://rewards-internals for this)
    • disconnected from Uphold (manually via brave://rewards), then reconnected
    • disconnected from Uphold (manually via panel), then reconnected
    • disconnected from Uphold (manually via Uphold settings on sandbox.uphold.com), then reconnected
    • restored a wallet with user funds, connected KYC'd Uphold account, confirmed user funds moved to Uphold (multiple new entries on Event logs tab of brave://rewards-internals for this)
    • added/updated/removed recurring tip from panel
    • triggered AC
  • Upgrade check 1

Screen Shot 2020-08-28 at 12 07 21 PM

  • Upgrade check 2
    • Installed 1.13.x, enabled Rewards
    • modified some AC settings
    • Closed 1.13.x, renamed profile to Dev
    • Launched with 1.14.x
    • Confirmed Event logs tab on brave://rewards-internals page
    • Confirmed promotion_corrupted_migrated2, version, wallet.seed, wallet.payment_id, enabled, creation_stamp, ac.next_reconcile_stamp, ac.enabled, and database_migrated` are listed.
    • Confirmed other changes made in 1.13.x are retained by checking on brave://rewards page.
  • Upgrade check 3
    • Installed 1.13.x, enabled Rewards
    • disabled Rewards
    • Closed 1.13.x, renamed profile to Dev
    • Launched with 1.14.x
    • Confirmed Rewards still off
    • Confirmed unable to see Event logs tab on brave://rewards-internals page
  • Logged follow up issue [Desktop] consider adding recurring tip amount for event logging in db #11497

Verification is in-progress


Brave | 1.14.74 Chromium: 85.0.4183.83 (Official Build) dev (64-bit)
-- | --
Revision | 94abc2237ae0c9a4cb5f035431c8adfb94324633-refs/branch-heads/4183@{#1658}
OS | Windows 10 OS Version 1903 (Build 18362.1016)

  • Verified test plan from Adds events to internals page brave-core#6383

  • Confirmed on Event logs tab of brave://rewards-internals there was an entry for ac.enabled set to 1 initially

  • After toggling AC off and refreshing brave://rewards-internals confirmed there was a new entry for ac.enabled which was now set to 0
    image

  • Compared the Preferences file to confirm this file reflects that AC is not enabled also

"rewards": {
      "ac": {
        "enabled": false,
  • Confirmed AC setting is retained on browser restart
    #################################Upgrade checks##############################################

  • Upgrade check 1

  • Upgrade check 2

    • Installed 1.13.x, enabled Rewards
    • modified some AC settings
    • Closed 1.13.x, renamed profile to Dev
    • Launched with 1.14.x
    • Confirmed Event logs tab on brave://rewards-internals page
    • Confirmed promotion_corrupted_migrated2, version, wallet.seed, wallet.payment_id, enabled, creation_stamp, ac.next_reconcile_stamp, ac.enabled, and database_migrated` are listed.
    • Confirmed other changes made in 1.13.x are retained by checking on brave://rewards page.

image

  • Upgrade check 3
    • Installed 1.13.x, enabled Rewards
    • disabled Rewards
    • Closed 1.13.x, renamed profile to Dev
    • Launched with 1.14.x
    • Confirmed Rewards still off
    • Confirmed unable to see Event logs tab on brave://rewards-internals page

-Encountered #11497

  • Modified each of the following items individually and confirmed a new entry was added to the Event logs tab of brave://rewards-internals for each one:
    • changed Monthly Payment value in Auto-Contribute pane
    • changed Monthly Payment value in Auto-Contribute settings
    • changed Minimum page time before logging a visit
    • changed Minimum visits for publisher relevancy
    • unchecked/checked Show non-verified sites in list
    • unchecked/checked Allow contribution to videos
    • removed recurring tip from Monthly Contributions pane
    • unchecked/checked Reddit in Tips settings
    • unchecked/checked Twitter in Tips settings
    • unchecked/checked GitHub in Tips settings

Verification passed on

Brave 1.14.75 Chromium: 85.0.4183.83 (Official Build) dev (64-bit)
Revision 94abc2237ae0c9a4cb5f035431c8adfb94324633-refs/branch-heads/4183@{#1658}
OS Ubuntu 18.04 LTS

Verified test plan from brave/brave-core#6383

  • Confirmed on Event logs tab of brave://rewards-internals there was an entry for ac.enabled set to 1 initially
  • After toggling AC off and refreshing brave://rewards-internals, confirmed there was a new entry for ac.enabled which was now set to 0
  • Compared to Preferences file to confirm this file reflects that AC is not enabled also
  • Confirmed AC setting is retained on browser restart

Upgrade check 1

Upgrade check 2

  • Installed 1.13.x, enabled Rewards
  • modified some AC settings
  • Closed 1.13.x, renamed profile to Dev
  • Launched with 1.14.x
  • Confirmed Event logs tab on brave://rewards-internals page
  • Confirmed other changes made in 1.13.x are retained by checking on brave://rewards page.
    Upgrade check 3
  • Installed 1.13.x, enabled Rewards
  • disabled Rewards
  • Closed 1.13.x, renamed profile to Dev
  • Launched with 1.14.x
  • Confirmed Rewards still off
  • Confirmed unable to see Event logs tab on brave://rewards-internals page
  • Encountered [Desktop] consider adding recurring tip amount for event logging in db #11497

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