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

stats are not updated on private window when default tab stats update #704

Closed
cezaraugusto opened this issue Aug 8, 2018 · 6 comments · Fixed by brave/brave-core#540
Closed
Assignees
Labels

Comments

@cezaraugusto
Copy link
Contributor

cezaraugusto commented Aug 8, 2018

Test Plan

See brave/brave-core#540

Description

  1. open a default window and a private window both on new tab page
  2. visit wired.com on the default window
  3. watch that stats on the private tab page didn't update

First reported by @simonhong and confirmed by @yrliou.

@cezaraugusto
Copy link
Contributor Author

worth mentioning that I was able to fix this with the patch below but others couldn't not reproduce the fix which is why this issue was created.

diff --git a/components/brave_new_tab_ui/components/app.tsx b/components/brave_new_tab_ui/components/app.tsx
index 6d1e02f..cdfb394 100644
--- a/components/brave_new_tab_ui/components/app.tsx
+++ b/components/brave_new_tab_ui/components/app.tsx
@@ -118,7 +118,7 @@ class NewTabPage extends React.Component<Props, {}> {
     if (this.props.newTabData.isIncognito) {
       return (
         <NewPrivateTab
-          stats={newTabData.stats}
+          newTabData={newTabData}
           useAlternativePrivateSearchEngine={this.useAlternativePrivateSearchEngine}
           onChangePrivateSearchEngine={this.onChangePrivateSearchEngine}
         />
diff --git a/components/brave_new_tab_ui/components/newPrivateTab.tsx b/components/brave_new_tab_ui/components/newPrivateTab.tsx
index 6c6cfb7..23e78c3 100644
--- a/components/brave_new_tab_ui/components/newPrivateTab.tsx
+++ b/components/brave_new_tab_ui/components/newPrivateTab.tsx
@@ -26,7 +26,7 @@ const privateTabIcon = require('../../img/newtab/private_tab_pagearea_icon.svg')
 require('emptykit.css')

 interface Props {
-  stats: NewTab.Stats,
+  newTabData: NewTab.State,
   useAlternativePrivateSearchEngine: boolean,
   onChangePrivateSearchEngine: (e: React.ChangeEvent<HTMLInputElement>) => void
 }
@@ -34,13 +34,13 @@ interface Props {
 export default class NewPrivateTab extends React.PureComponent<Props, {}> {
   render () {
     const {
-      stats,
+      newTabData,
       useAlternativePrivateSearchEngine,
       onChangePrivateSearchEngine
     } = this.props

     // do not render if stats aren't loaded yet
-    if (!stats) {
+    if (!newTabData) {
       return null
     }

@@ -48,7 +48,7 @@ export default class NewPrivateTab extends React.PureComponent<Props, {}> {
       <Page theme={theme.newPrivateTab}>
         <Grid columns={3}>
           <Column size={2}>
-            <Stats stats={stats} />
+            <Stats stats={newTabData.stats} />
           </Column>
           <Column size={1} theme={theme.clockContainer}>
             <Clock theme={theme.clock} />

@cezaraugusto
Copy link
Contributor Author

self assigning to keep track but won't make it this week so up for grabs in the meanwhile

@cezaraugusto cezaraugusto self-assigned this Aug 8, 2018
@cezaraugusto
Copy link
Contributor Author

cezaraugusto commented Aug 8, 2018

here's the proof of work of the above patch. By now it seems like something changed in the API as no new updates to the web ui were made when this was tested. SHA brave/brave-core@dc1e224 and current master SHA
brave/brave-core@c3d0cb0

test1

@bbondy bbondy added this to the Releasable builds 0.55.x milestone Aug 16, 2018
@bbondy bbondy modified the milestones: Releasable builds 0.55.x, 1.x Backlog Sep 22, 2018
@bbondy
Copy link
Member

bbondy commented Sep 22, 2018

Moving to 1.x since it wouldn't be the end of the world if we don't make this by 0.55.x or 1.0

@rebron rebron added the priority/P5 Not scheduled. Don't anticipate work on this any time soon. label Sep 28, 2018
cezaraugusto added a commit to brave/brave-core that referenced this issue Oct 2, 2018
@bsclifton bsclifton modified the milestones: 1.x Backlog, Releasable builds 0.55.x Oct 2, 2018
@bsclifton
Copy link
Member

Pulling back to 0.55.x since there's a fix 😄
brave/brave-core#540

@srirambv
Copy link
Contributor

srirambv commented Oct 5, 2018

Verification Passed on

Brave 0.55.11 Chromium: 70.0.3538.35 (Official Build) beta (64-bit)
Revision 28dcb499844fa40c28d5f62e337876cb936f79f5-refs/branch-heads/3538@{#678}
OS Linux
  • Verified the stats are auto update on private tab when a site is visited on normal tab

Verification passed on

Brave 0.55.11 Chromium: 70.0.3538.35 (Official Build) beta (64-bit)
Revision 28dcb499844fa40c28d5f62e337876cb936f79f5-refs/branch-heads/3538@{#678}
OS Windows 7

Verified passed with

Brave 0.55.11 Chromium: 70.0.3538.35 (Official Build) beta(64-bit)
Revision 28dcb499844fa40c28d5f62e337876cb936f79f5-refs/branch-heads/3538@{#678}
OS Mac OS X

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

Successfully merging a pull request may close this issue.

7 participants