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

Handle Assignment Reminders with no due date #15

Open
timcortesi opened this issue Dec 26, 2020 · 3 comments
Open

Handle Assignment Reminders with no due date #15

timcortesi opened this issue Dec 26, 2020 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@timcortesi
Copy link
Member

In app/Console/Kernel.php around like 47:
We Need to confirm that $assignment->date_due is not null before continuing:

$differenceInDays = $assignment->date_due->diffInDays(Carbon::now());

We should also look at the situations which would cause a null date_due. Is this problematic in other situations? Should this be allowable?

If date_due is null, we get the following error:

[2020-12-26 02:00:19] prod.ERROR: Call to a member function diffInDays() on null {"exception":"[object] (Symfony\\Component\\Debug\\Exception\\FatalThrowableError(code: 0): Call to a member function diffInDays() on null at /var/app/current/app/Console/Kernel.php:47)

We should probably also wrap all of the code inside the module_assignment loop with a try/catch so that it will continue in the event that ANYTHING fails within the loop (around line 43):

//Checks all of the assignment due dates to send emails to users
foreach($module_assignments as $assignment){
    // ADD A "try" block here!!
    $module = $modules->where('id',$assignment->module_id)->first();
    $user = $assignment->user()->where('id',$assignment->user_id)->first();
@timcortesi timcortesi added the bug Something isn't working label Dec 26, 2020
@timcortesi
Copy link
Member Author

Tagging @phelpsa as an FYI on this issue.

@alikemaltanriverdi
Copy link
Member

Fault prevention mechanism has been added to the Kernel.php and seems to be working fine. Once the all tests are done, I will commit my changes.

@alikemaltanriverdi
Copy link
Member

The most up to date code is now in the BComply environment and it seems to be working fine so far. I will post another update once we think everything is working as expected and we are ready to go live. In order for me to complete the tests, I will need to wait for Bulk Assignment to run tomorrow (at 2am or 2:30am?) as scheduled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants