> On May 9, 2017, 8:54 p.m., Benjamin Mahler wrote:
> > src/webui/master/static/js/controllers.js
> > Lines 1016-1017 (patched)
> > <https://reviews.apache.org/r/58872/diff/2/?file=1706418#file1706418line1026>
> >
> >     I'm a bit confused as to why we would want to set up the listener if we 
> > already called reroute(). Does this belong in the else case?
> >     
> >     ```
> >         if ($scope.state) {
> >           reroute();
> >         } else {
> >           var removeListener = $scope.$on('state_updated', reroute);
> >           $scope.$on('$routeChangeStart', removeListener);
> >         }
> >     ```
> >     
> >     Also, why is it safe to call reroute on every state update? It seems 
> > there are a few cases to consider:
> >     
> >     Case 1: reroute actually routes away from the page, then we're ok 
> > because the listener is removed
> >     
> >     Case 2: reroute calls goBack, we're ok because the listener is removed 
> > (there is a separate question we should consider later, which is whether 
> > going back is the best thing to do)
> >     
> >     Case 3: reroute navigates "home" (/) if we get an error response, this 
> > is ok since the listener is removed
> >     
> >     How about adding a comment here that reroute is expected to always 
> > route away from the page and so the listener is removed after the first 
> > state update?

Thanks @bmahler's detail review. Let me add a comment for it.


- haosdent


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/58872/#review174374
-----------------------------------------------------------


On May 3, 2017, 4:15 a.m., haosdent huang wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/58872/
> -----------------------------------------------------------
> 
> (Updated May 3, 2017, 4:15 a.m.)
> 
> 
> Review request for mesos, Benjamin Mahler and Tomasz Janiszewski.
> 
> 
> Bugs: MESOS-4992
>     https://issues.apache.org/jira/browse/MESOS-4992
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Open sandbox link in a new tab would fail since it depends on agents
> information loading finish. This patch fixes it by ensuring the agents
> information loaded first and then rerouting the sandbox request.
> 
> 
> Diffs
> -----
> 
>   src/webui/master/static/js/controllers.js 
> a021962573d452de1581e6a7717016eac7d0cd85 
> 
> 
> Diff: https://reviews.apache.org/r/58872/diff/2/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> haosdent huang
> 
>

Reply via email to