-
Notifications
You must be signed in to change notification settings - Fork 111
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
Fix issue of user not being able to submit assignment when logged in root account #2989
base: master
Are you sure you want to change the base?
Conversation
…root account refs: MBL-18064 affects: Student release note: Fixes issue of user not being able to submit assignment when logged in root account
Release Note:Fixes issue of user not being able to submit assignment when logged in root account Affected Apps: Student, Teacher
|
refs: MBL-18064 affects: Student,Teacher release note: Fixes issue of user not being able to submit assignment when logged in root account
I updated the code to use the Router's For the point of API tweaking, when attempted I had to face the issue of this property access on AppEnvironment.shared.currentSession?.baseURL.host Which is very common place in code, and it is sometimes used to authenticate API requests, which would make the tweak of the If we were to go this route, we must guarantee that the value of this property on That's why using Places where you can find such access: canvas-ios/Core/Core/API/API.swift Line 244 in 014347f
|
private let env = AppEnvironment.shared | ||
|
||
public init(assignment: Assignment, courseColor: UIColor?) { | ||
public init(env: AppEnvironment, assignment: Assignment, courseColor: UIColor?) { |
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 think we usually pass in the primary data/model first which is the main subject of the whole type.
Then the secondary ones.
And in the end we pass in the dependecies, like interactors, env, router, etc.
Maybe this is only me, but it would make sense to me to keep this ordering.
May look like nit, but I would rather call this out now, at the beginning of this approach.
The same stands for all the other places where we inject env
in this PR. cc @vargaat for thoughts
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.
Yes, I agree, that bloated environment object is definitely not a primary dependency. I didn't notice this during my review but let's keep the priority order in the future.
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.
QA+1, I was able to submit to both consortia and my regular account various ways. What I noticed and I'm not sure if this can cause any issues or not is that when submitting via the share extension the file upload request still goes to the root account while the submission goes to the child domain. This is because the file upload logic for the share extension fetches the base url for its own but only for the last API request. On the image the non-selected rows are from the share extension and bottom ones from the app.
I also managed to make the app crash two times during submitting files from the app. I couldn't reproduce it with Xcode and for some reason the crash symbolication didn't succeed so let's keep an eye out for this while testing the RC.
refs: MBL-18064
affects: Student,Teacher
release note: Fixes issue of user not being able to submit assignment when logged in root account
What's changed
The main point of change of this PR resides in files:
AppEnvironmentOverride
CourseTabUrlInteractor
Router
This is to provide a clean way to pass a modified
AppEnvironment
with the correct baseURL that fits the current tab user is sitting at, which in this case isCourse > Assignments
The rest are a consequence of those changes, which is basically to make sure views and classes are respecting what ever
AppEnvironment
instance is passed to them.Test Plan
See ticket description.
Also, made testing for ordinary accounts for following use cases:
Also, testing for the following scenarios:
Screen Record
demo_consortia.mov
Checklist