-
Notifications
You must be signed in to change notification settings - Fork 5
Remove immediate onboarding feature flag #741
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
Changes from all commits
8f7edd1
f6ec5d0
41e69a7
21f3b39
ecfbf29
868563f
688c8d2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,11 +10,8 @@ def call(school_params:, creator_id:, token:) | |
| School.transaction do | ||
| response[:school].save! | ||
|
|
||
| # TODO: Remove this conditional once the feature flag is retired | ||
| if FeatureFlags.immediate_school_onboarding? | ||
| onboarded = SchoolOnboardingService.new(response[:school]).onboard(token:) | ||
| raise 'School onboarding failed' unless onboarded | ||
| end | ||
| onboarded = SchoolOnboardingService.new(response[:school]).onboard(token:) | ||
| raise 'School onboarding failed' unless onboarded | ||
| end | ||
|
jamiebenstead marked this conversation as resolved.
Comment on lines
10
to
15
|
||
|
|
||
| response | ||
|
|
||
This file was deleted.
This file was deleted.
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.
School::Create.callwraps save+onboarding in aSchool.transactionbut then rescues the raised error and returns a failure response. IfSchool::Create.callis invoked inside an outer transaction (e.g.SchoolImportJobwraps it inSchool.transaction), this can prevent the outer transaction from rolling back while still returning failure, leaving the created school (and possibly roles) committed. To keep the operation atomic regardless of caller context, consider usingSchool.transaction(requires_new: true)(savepoint) or otherwise ensuring the DB changes are rolled back when onboarding fails before returning a failure response.