Skip to content
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

[MOB-6063] updates parameter types for setEmail and setUserId #491

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions ts/Iterable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,11 +209,11 @@ class Iterable {
*
* Note: specify a user by calling Iterable.setEmail or Iterable.setUserId, but NOT both.
*
* @param {string | undefined} email email address to associate with the current user
* @param {string | null} email email address to associate with the current user
* @param {string | undefined} authToken valid, pre-fecthed JWT the SDK can use to authenticate API requests, optional - if null/undefined, no JWT related action will be taken
*/

static setEmail(email: string | undefined, authToken?: string | undefined) {
static setEmail(email: string | null, authToken?: string | null) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think @pauljung14 suggested to have undefined AND null both.
so it will be string | undefined | null

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can find my suggestion in the comments of the JIRA ticket

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah gotcha. I was thinking that we wanted the email to be required. But, I will make the change.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to verify what behavior occurs when the user is undefined. Are we logging out the user?

Iterable.logger.log("setEmail: " + email)

RNIterableAPI.setEmail(email, authToken)
Expand Down Expand Up @@ -262,11 +262,11 @@ class Iterable {
*
* Note: specify a user by calling Iterable.setEmail or Iterable.setUserId, but NOT both.
*
* parameters: @param {string | undefined} userId user ID to associate with the current user
* parameters: @param {string | null} userId user ID to associate with the current user
* optional parameter: @param {string | undefined} authToken valid, pre-fecthed JWT the SDK can use to authenticate API requests, optional - if null/undefined, no JWT related action will be taken
*/

static setUserId(userId: string | undefined, authToken?: string | undefined) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And here

static setUserId(userId: string | null, authToken?: string | undefined) {
Iterable.logger.log("setUserId: " + userId)

RNIterableAPI.setUserId(userId, authToken)
Expand Down