Skip to content

Conversation

@madmas
Copy link

@madmas madmas commented May 6, 2020

add debug outout and exception handling fix to get rid of over-and-over sent notifications.

I think esp. the changes to line 410 helped to fix the issue.

@kesselb
Copy link
Contributor

kesselb commented Jun 17, 2020

How does logException fixes something? Mind to share $e->getMessage() to see why sending the email failed?

@madmas
Copy link
Author

madmas commented Jun 24, 2020

Hi @kesselb , sorry, I switched the lines, I think the actual fix is below, in line 415. 410 of course only helps in regard of debugging ;-)

@madmas madmas force-pushed the endlessNotificationsFix branch from e85a42f to 19e481f Compare June 24, 2020 10:12
@kesselb
Copy link
Contributor

kesselb commented Jun 24, 2020

Mind to share the exception? Also you overwrite the actual exception message. That makes it harder to debug.

Copy link
Contributor

@kesselb kesselb left a comment

Choose a reason for hiding this comment

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

I'm not convinced. Right now the error handling code fails and the original exception message is replaced with a generic error message.

} catch (\Exception $e) {
$this->logger->logException($e, [
'message' => 'Failed sending email to user "{user}"',
'user' => $user,
Copy link
Contributor

@kesselb kesselb Jun 24, 2020

Choose a reason for hiding this comment

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

Log the exception with $this->logger->logException($e); and log a additional warning $this->logger->warning('Failed to send notification email for user {user}', ['user' => $userName]);. You cannot use $user because it's a IUser object. Ah that might work as the normalizer will format it. I would still prefer the $userName ;)

change the glue for implode from | to ,

Co-authored-by: kesselb <[email protected]>
@madmas
Copy link
Author

madmas commented Jun 26, 2020

I'm not convinced. Right now the error handling code fails and the original exception message is replaced with a generic error message.

My experience was vice versa - with the output I added with shown here, I got much more details.
I cannot share the exception as after implementing this, I don't see them happen on my system anymore....

@kesselb
Copy link
Contributor

kesselb commented Jun 26, 2020

We still don't know why sending the notification failed in the first place. This is fixing symptoms not problems 😟

@blizzz blizzz added this to the Nextcloud 30 milestone Apr 8, 2024
@skjnldsv skjnldsv mentioned this pull request Aug 22, 2024
44 tasks
@blizzz blizzz modified the milestones: Nextcloud 30, Nextcloud 31 Sep 4, 2024
@blizzz blizzz mentioned this pull request Jan 29, 2025
1 task
@blizzz blizzz modified the milestones: Nextcloud 31, Nextcloud 32 Jan 29, 2025
@skjnldsv skjnldsv modified the milestones: Nextcloud 32, Nextcloud 33 Sep 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants