fix(admin-ui): fix analytics config not being saved in invite form #5467
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.
What
Remove the feature flag check for analytics in invite form and always try to send a request to the create analytics config endpoint.
Why
As the user is not authenticated when they accept an invite, the request to
/admin/store
that's meant to retrieve enabled feature flags will result in401
. So, the check on whether the feature flag is enabled before creating the analytics configuration for the user will always be false, and the configuration will never be created.With this fix, we always try to create analytics configuration for the user. If the analytics feature flag is disabled, which leads to the Create Analytics Config route not being registered and resulting in a 404 error, we gracefully catch the error without disrubting the invite flow.