Fix strange code, add messages to code brought in #8106#13509
Fix strange code, add messages to code brought in #8106#13509jesusvazquez merged 1 commit intoprometheus:mainfrom
Conversation
077dcaf to
284f086
Compare
Signed-off-by: Mikhail Fesenko <proggga@gmail.com>
|
Prob it works because it resets buffer but not sure, I'll try to add some tests here today evening |
Uhm, not sure. The |
|
Agree, so I'm kinda not sure how it passed this test |
jesusvazquez
left a comment
There was a problem hiding this comment.
LGTM thanks for the fix! As marco said too bad a test did not catch this. If you are willing to add another PR for the test that would be awesome
|
I think I may have understood why no test was failing. The length was written twice, but both times at the same position, overwriting the |
|
Ah looks like you're right, it does w.write ... startPos, the same pos to write, so it re-write over and doesn't break anything, just writing 2 times |
|
Even the written length should have been correct, because |
|
Can you please point me in doc, becuase I can't find any piece of doc saying about updateing position. Just need that to learn |
My reasoning:
|
|
i see, interesting |
|
Postmortem: |
|
Thanks both for caring about this so much 👍 |
…ometheus#13509) Signed-off-by: Mikhail Fesenko <proggga@gmail.com>
3-4 years ago I did a change for hackaton and today it was merged #8106 . I realized that I extracted method but in one place I extracted only half of function. Not sure this is good for code so I did a second PR (this) and added error messages because in any issues it will be hard to debug