EandrewJones commented on code in PR #412:
URL: https://github.com/apache/flagon-useralejs/pull/412#discussion_r1488796048


##########
src/UserALEWebExtension/background.js:
##########


Review Comment:
   Alright, I am following this code.
   
   Nonetheless, I'm ripping off the band-aid. It's time to add Doc strings top 
each function.



##########
src/UserALEWebExtension/background.js:
##########
@@ -63,27 +65,44 @@ function filterUrl(log) {
   return false;
 }
 
+// Sets http session id of tab logs to that of the target tab
+function injectSessions(log) {
+    let id = log.details.id;
+    if(id in tabToHttpSession) {
+      log.httpSession = tabToHttpSession[id];
+    } else {
+      log.httpSession = null
+    }
+    log.browserSessionId = browserSessionId;
+    return log;
+}
+
 browser.storage.local.get(defaultConfig, (res) => {
   // Apply url filter to logs generated by the background page.
-  userale.addCallbacks({filterUrl});
+  userale.addCallbacks({filterUrl, injectSessions});
   updateConfig(res);
+  browserSessionId = 
JSON.parse(window.sessionStorage.getItem('userAleHttpSessionId'));

Review Comment:
   Is this the only place where the browserSessionId is set?
   
   Why does this come from userAleHTTPSessionId?



-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@flagon.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@flagon.apache.org
For additional commands, e-mail: notifications-h...@flagon.apache.org

Reply via email to