-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Id 367 get user registration from sam #4716
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some small comments, not necessarily blocking
programLocationCountry: 'testProgramLocationCountry', | ||
researchArea: 'testResearchArea', | ||
starredWorkspaces: 'testStarredWorkspaces', | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
double approved
export interface RexFirstTimestampResponse { | ||
timestamp: Date; | ||
} | ||
|
||
export interface SamUserResponse { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added the undefined so we can initialize with an empty object in state
const { terraUser, samUser } = userStore.get(); | ||
// for Sam users who registered before we started tracking registration dates in Sam, | ||
// registeredAt may be null in the Sam db. In that case, use epoch instead | ||
const dateJoined = samUser.registeredAt ? samUser.registeredAt.getTime() : new Date('1970-01-01').getTime(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could also just rely on the createdAt
date, since its not nullable in Sam's DB. That might be preferable, just in case there's a real createdAt
, but not a registeredAt
, for some reason.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we want to user createdAt
because then a user who is invited, waits a month to register, then comes to Terra would immediately be shown the survey
Quality Gate passedIssues Measures |
Jira Ticket: https://broadworkbench.atlassian.net/browse/ID-367
Summary of changes:
remove use of Rex in the UI. Rex is only used to get the registration date to send to Appcues for the NPS Survey. This change gets the registration date from Sam instead, and removes references to Rex from the UI.
The unit tests in login.test.ts are testing new code areas, so I would appreciate a thorough review of those as well. Since these are some of the first auth.ts tests, I want to ensure we're setting a good example for future tests to work from.
Why
We are retiring Rex because we now have the same data stored in Sam
Testing strategy
Appcues itself isn't activated on lower envs, so I'm actually not sure how to test that. However I did verify that the result returned from Sam is the same as was returned from Rex. For testing the changes generally, logging into Terra should be sufficient as it is called on loadTerraUser which is called upon login.
Manually tested general functionality by running locally and logging in