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

Why add the dot at the end of the message within the gem? #113

Open
lcx opened this issue Jul 28, 2021 · 2 comments
Open

Why add the dot at the end of the message within the gem? #113

lcx opened this issue Jul 28, 2021 · 2 comments

Comments

@lcx
Copy link

lcx commented Jul 28, 2021

I was wondering why my specs where suddenly failing after updating the gem.

CleanShot 2021-07-28 at 12 33 41

Which led me to this change:
6269b9d#diff-62b6b428a662cf081fc326b69c57f59ac43aa727604a75eccfde66538031827fR93

It's a quick fix on my side but why modify the existing message within the gem? What problem does it solve?
Also somehow in some situations I'm seeing two dots at the end 🤔
Just noticed that it expects dot + space, but still I get an additional dot added.

@lcx
Copy link
Author

lcx commented Jul 28, 2021

ok, now I see.
my error message looks like this

"C: cdr / host last imported at 2021-07-28 08:49:22. "

it does nothing at this line since errors.end_with?('. ') returns true.

errors << '. ' unless errors == '' || errors.end_with?('. ')

then it continues with return errors.strip which now returns C: cdr / host last imported at 2021-07-28 08:49:22. without the space.
Then it get's back into process_checks, now errors being C: cdr / host last imported at 2021-07-28 08:49:22. without the space in the end so a period + space is entered again.

@lcx
Copy link
Author

lcx commented Jul 28, 2021

a bit of further digging,
if I call get '/health_check/all.json' it will run

when "all", "full"
  errors << HealthCheck::Utils.process_checks(HealthCheck.full_checks, called_from_middleware)

here I will get the errors stripped of the space.
but at the end it will run into

errors << '. ' unless errors == '' || errors.end_with?('. ')

again and add a second period.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant