Skip to content

Conversation

@louischan-oursky
Copy link
Contributor

ref DEV-2341

Comment on lines +1 to +15
# The use of variables
#
# We use simply expanded variables in this Makefile.
#
# This means
# 1. You use ::= instead of = because = defines a recursively expanded variable.
# See https://www.gnu.org/software/make/manual/html_node/Simple-Assignment.html
# 2. You use ::= instead of := because ::= is a POSIX standard.
# See https://www.gnu.org/software/make/manual/html_node/Simple-Assignment.html
# 3. You do not use ?= because it is shorthand to define a recursively expanded variable.
# See https://www.gnu.org/software/make/manual/html_node/Conditional-Assignment.html
# You should use the long form documented in the above link instead.
# 4. When you override a variable in the command line, as documented in https://www.gnu.org/software/make/manual/html_node/Overriding.html
# you specify the variable with ::= instead of = or :=
# If you fail to do so, the variable becomes recursively expanded variable accidentally.
Copy link
Contributor

Choose a reason for hiding this comment

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

Did you find any problem with the original ?= recursively expanded variable?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No problem in our current usage. I just learnt this today and realized we are not very consistent with the use of the variables. We never intent to use recursively expanded variables.

Comment on lines 484 to 496
inviteeExists, err := s.checkInviteeExistenceByEmail(ctx, invitedBy, inviteeEmail)
if err != nil {
return nil, err
}

if !inviteeExists {
err = s.createAccountForInvitee(ctx, invitedBy, inviteeEmail)
if err != nil {
return nil, err
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

New developers (If any) reading this part may be confused:
Why createAccountForInvitee is called but actually no account created?

What about:

// In CollaboratorService.SendInvitation
if IsAuthgearOnce {
  // ... checkInviteeExistenceByEmail
  // ... createAccountForInvitee
}

// In another file
//go:build !authgearonce
// +build !authgearonce
const IsAuthgearOnce = false

// In another file
//go:build authgearonce
// +build authgearonce
const IsAuthgearOnce = true

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agree, let me make the change according to your suggestion.

@louischan-oursky louischan-oursky force-pushed the dev-2341-once-user-provision branch from b11c96d to 12cdeec Compare December 12, 2024 07:49
@tung2744 tung2744 merged commit 8360c2d into authgear:main Dec 12, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants