Request for comment: bug in webpanel affects YunClient. Should we fix it?

We’ve just found out that we did a mistake in webpanel code, the part that handles the “/arduino” urls

The bug lies here: for /arduino URLs (and just for them) the YunClient receives a string that terminates with a

\r\n

instead than a simple

\n

I’m for fixing the bug, releasing a new webpanel (which you will see as an updated luci-app-arduino-webpanel package) and fixing the Bridge example in the IDE.

However, IF your sketches rely on the presence of such extraneous \r AND IF you update the webpabel package THEN you’ll need to update your sketches as well

The alternative is to leave things as they are, perhaps adding a comment to that code expressing sadness about the bug found but not corrected for sake of backward compatibility

Your thoughts?

I would definitely fix it, and clearly note it in the release notes.

What is the actual problem with sending \r\n?
Regardless of Arduino, I always check for \r and \n in my sketches, scripts, or code..

It's useless. Every char is good to be used as a separator. "\n" sometimes has a special meaning as buffered stuff uses it as a signal for "ok, now I must send this data, really". "\r" was added by mistake and it's of no use

Then it is not a bug. It is an improvement.

mamu:

[quote author=Federico Fissore link=topic=243028.msg1742309#msg1742309 date=1401281917]
It's useless. Every char is good to be used as a separator. "\n" sometimes has a special meaning as buffered stuff uses it as a signal for "ok, now I must send this data, really". "\r" was added by mistake and it's of no use

Than it is not a bug. It is an improvement.
[/quote]
I agree.
I always ignore the \r in my code because that makes it most robust.
Jantje

mamu:
Then it is not a bug. It is an improvement.

You're right. Things work and we want to make them work better, therefore improving them. I consider it a bug since it was added by mistake. IMHO improving the effect of a mistake is fixing a bug. But this is philosophy :slight_smile:

Yep, go for it, do the improvement :slight_smile: