This repository has been archived by the owner on Jan 18, 2024. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes an issue with expo-cli@3.22.x where the number of logged
Start Project
andServe Manifest
events are significantly lower than expected.Paired with @animeeples to investigate and we found the root cause to be that by the time the
Serve Manifest
event should be sent, the_userId
field in Analytics.ts is not set, meaning the following statement evaluates to false and the event is never sent to segment:expo-cli/packages/xdl/src/Analytics.ts
Line 41 in d7e4d4d
Following the chain of methods that set the
_userId
field, it looks like this issue was introduced by 553eb01 which eliminated a call toUserManager.ensureLoggedInAsync()
(553eb01#diff-bf9f0db58154788a372e25a5c3898adbL2009). This method will set the_userId
field on Analytics.ts if it is not already set.This PR restores the previous functionality by adding a call to
UserManager.ensureLoggedInAsync()
in the analogous location, in order to keep these two metrics the same as before and preserve comparisons to historical data.Looking further ahead, it would be good to
_userId
field in Analytics, so it's not such a hidden side effectBut this PR is a first step/quick fix to get the metrics back to the place they were before 3.22.0.