Reduce segment wait until load time
Summary: https://phab.corp.pixielabs.ai/D6494 updated login so that we don't redirect the page until the segment analytics have been sent. this makes the user waiting the "logging in" page until the segment callback is complete. now that it is in prod, logging in just seems way too slow because of this wait. it takes 5 seconds on the "logging in" page. after further investigation, its because the wait has to also wait for segment to load and initialize. we first wait for the CPU to be idle, then wait an addtional 5 seconds before loading segment. i reduced this to 2 seconds, which seems more bearable for login. if we want login to be snappier we would either: - remove this timeout so that segment loads as soon as the CPU is idle. or - move the identify/track to another page. but by doign this, we will lose the login/logout event Test Plan: ran in webpack Reviewers: zasgar, #engineering Reviewed By: zasgar, #engineering Differential Revision: https://phab.corp.pixielabs.ai/D6518 GitOrigin-RevId: 88fc85688666a01f02a02c5c020d60c5bb0eb3ea
Showing
+15 -10
Please register or sign in to comment