ruffle1986 commented on issue #1575: METRON-2335: [UI] Implement 
synchronization between browser user state and Hbase user state
URL: https://github.com/apache/metron/pull/1575#issuecomment-564994299
 
 
   @sardell found a race condition in the app during testing. I tested the 
changes with the dev tools opened which slows down the runtime so I hadn't got 
the chance to meet the problem.
   
   So there was a race between the user settings service loading the data from 
the server and the alerts list component. Sometimes the component got rendered 
earlier before the user settings service loaded the settings successfully. 
   
   The main goal was to load the user settings before anything is rendered on 
the screen and originally I wanted to use the `APP_INITIALIZER` to load the 
settings but the user needs to be logged in in order to reach hdfs via the api 
service, so the `APP_INITIALIZER` could not have worked. That's why I put this 
mechanism into the Authentication service but it led to a race condition. 
   
   So I came up with another strategy and implemented a resolver which can be 
used as a route guard in the routing module. By implementing the resolver, I 
managed to make sure that the user settings are successfully loaded from the 
server before the route component gets rendered. 
   
   Thanks for catching this issue, @sardell 👍!

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to