-
Notifications
You must be signed in to change notification settings - Fork 4
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][SOLAR-387] Add fallback when no registration available or FF TAO_AS_A_TOOL is disabled #392
[FIX][SOLAR-387] Add fallback when no registration available or FF TAO_AS_A_TOOL is disabled #392
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## develop #392 +/- ##
=============================================
- Coverage 30.59% 30.35% -0.25%
- Complexity 817 822 +5
=============================================
Files 104 104
Lines 2853 2876 +23
=============================================
Hits 873 873
- Misses 1980 2003 +23
☔ View full report in Codecov by Sentry. |
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.
- New code is covered by tests (if applicable)
- Tests are running successfully (old and new ones) on my local machine (if applicable)
- New code is respecting code style rules
- New code is respecting best practices
- New code is not subject to concurrency issues (if applicable)
- Feature is working correctly on my local machine (if applicable)
- Acceptance criteria are respected
- Pull request title and description are meaningful
- Pull request's target is not
master
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.
Review Checklist
- New code is covered by tests (if applicable)
- Tests are running successfully (old and new ones) on my local machine (if applicable)
- New code is respecting code style rules
- New code is respecting best practices
- New code is not subject to concurrency issues (if applicable)
- Feature is working correctly on my local machine (if applicable)
- Acceptance criteria are respected
- Pull request title and description are meaningful
- Pull request's target is not
master
- Commits are following conventional commits
- Commits messages are meaningful
- Commits are atomic
- Changelog is updated according to changes (if applicable)
- Documentation is updated according to changes (if applicable)
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.
My recommendation is to fallback into redirect after we catches exception from . getValidatedLtiMessagePayload
method
If I understood correctly this is what I am doing. |
try { | ||
$message = $this->getValidatedLtiMessagePayload(); | ||
} catch (LtiException $exception) { | ||
if ($exception->getMessage() !== self::LTI_NO_MATCHING_REGISTRATION_FOUND_MESSAGE) { |
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 should use an Exception code or Exception type to define this not a message string. This is a blocker for me.
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.
Sometimes exceptions don't implement the code and its hard to add it, maybe that's the case. But of course better would be to use code of specific exception class to check.
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.
Thanks @Karol-Stelmaczonek , yes, I do not have a code here. I would use it in case I have it, ofc
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.
Can you make changes to the exception so it will be easy to recognise the type of exception?
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 would avoid creating a new release on Lti1p3Core only for this.
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.
IMO this is the fallback mechanism and we could title this PR as add fallback when no registration available
. This is an important change and we should be careful with our changes and we should describe them with clarity. Also, I would say it is a feature, not a bug.
Version
There are 0 BREAKING CHANGE, 0 feature, 2 fixes |
It's not common to refer to a "fallback" as a "feature." Typically, a "fallback" is a contingency strategy or action triggered when something doesn't work as expected, or when a system cannot perform its primary task. For example, in programming, a "fallback" can be an alternative function that is executed if the main function fails. In security systems, a "fallback" can be a backup procedure in case the primary systems fail. A "feature" is usually a planned and desired functionality of a system, product, or service that is designed to meet specific user needs. Features are intentional components of a system, while a "fallback" is a contingency response to unforeseen situations. In summary, it's not appropriate to say that a "fallback" is a "feature" because they serve different roles in a system or product. |
We should redirect the user to the default login page in case:
Please check the bug ticket for more details.
Demo
Current Behavior
current.mov
The fix
bugfix.mov