Replace UrlEncode library with local implementation.#811
Replace UrlEncode library with local implementation.#811rbergen merged 25 commits intoPlummersSoftwareLLC:mainfrom
Conversation
…ncode include/effects/matrix/PatternSubscribers.h: Removed unused include of UrlEncode platformio: Remove external dependency of UrlEncode src/deviceconfig.cpp: If we don't have WiFi, we don't have a URL. src/network.cpp: Add textbook implementaion of urlEncode. effects/matrix/PatternSubscribers.h: Removed unused include of UrlEncode
|
@robertlipe Just quickly checking if you're planning to get back to this? |
|
Yes. Distracted with other projects... Some of which are ND, but in
different trees.
The rationale was to minimize and localize the change. That's why I
kept/made the header. We have a ton of audio/networking code that isn't
"correctly" conditionalized so I didn't go on a recursive chase for that. I
minimized the blast radius.
But I understood that's what it takes, so I'll come back to this.
As for the "yeah, right", thing, I probably lead you to that. My distaste
of the platformio approach is not exactly a secret. I have another, more
extreme version of this that brings in ALL (?) the libs (and has a python
thingy that checks them out/updates them).
That lets us actually FIX some of the abandoned and misguided code we're
depending on and reduces our dependencies on Platformio's buggy, slow build
system, which is two things that I'm not a fan of in any software.
It makes builds less slow because we're not waiting for 200+network
fetches, making 50 copies of everything, and filling our disks with
redundant copies. Trying to get patches accepted upstream into abandoned
projects just isn't working and I really don't want to become a general
purpose fork of those packages; I just want them integrated sensibly.
This one was just easier to cold replace. Im testing the waters. 😎
But, like so many things in my ND world right now, it's piled up behind
other things.
The Arduino3/P4 thing may depend on it...
I actually took a break from that very recently and developed two new fun
effects from scratch. I have a few more in the idea incubator, too.
I also have a note at home that there was something else I recently
half-proposed that you'd pre-approved in principle, so it's on my near-term
list, too. Oh, and some doc.
I've not forgotten about the project. Far from it.
…On Sat, Jan 10, 2026, 3:00 PM Rutger van Bergen ***@***.***> wrote:
*rbergen* left a comment (PlummersSoftwareLLC/NightDriverStrip#811)
<#811 (comment)>
@robertlipe <https://github.com/robertlipe> Just quickly checking if
you're planning to get back to this?
—
Reply to this email directly, view it on GitHub
<#811 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACCSD3Y4KS7DZBB6IG6KTPD4GFR5VAVCNFSM6AAAAACQWIG6NOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTOMZTGU2DOOBWGU>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
|
No problem, I was just checking in, in the context of regular PR housekeeping.
Well actually, I understand the header, or a header separate from any others we have. It's networking-related code in our thinking, but pulling in network.h wherever URL encoding may be need feels like overkill. Maybe a utilities.h (with accompanying .cpp) would make more "generic" sense in our specific context, particularly considering your ideas about a possible future for other dependencies. In any case, the other thing (the current scope of #if ENABLE_WIFI) I feel far more strongly about.
Haha, I always love it when people make vague references to things I've pre-approved in principle. ;)
I didn't think that for a second. My question was strictly scoped to this PR. |
…ENABLE_WIFI, that is just silly. For all the (annoying) default on cases, verify that ENABLE_WIFI is set
3.9.2. My build passed on 3.7.10.
…hyper ESPNOW check.
rbergen
left a comment
There was a problem hiding this comment.
One minor case of PR creep, which I've noted for the record. LGTM otherwise.
There was a problem hiding this comment.
I'll pretend I didn't see this feature being snuck in with the UrlEncode refactor. ;)
There was a problem hiding this comment.
Thank you for the integration.
Moving uptime, unchanged, from a file that was networking (where it used to live because debug stuff was entangled with network stuff) to a file that is home for debugging was not a new feature and was not sneaky. It was a very deliberate change as part of making ENABLE_WIFI (which clearly otherwise applies to networking.cc) honest, as it required that method to be rehomed so it could still be available even in builds without ENABLE_WIFI, as this is useful over the console port.
I landed DoUptime back in 2023 in #402 because when running long times for leaks or stability testing, I want to see that it's been running a long time and didn't crash or reboot minutes before I walked back into the room. Even then we noted it was an awkward fit
But agreed that this PR morphed from "don't download and install a 20 line function 50 times" to make ENABLE_WIFI (and related networking #defines) actually bracket when they claim to bracket. That was me taking your request to its conclusion.
There was a problem hiding this comment.
...which I appreciate. In any case, the comment was mainly about the addition of the "uptime" command to the CLI command set. To which you may say "are you serious?", to which I would reply "no, that's why I approved and merged."
I think the PR adds a number of sanity checks/extra safeguards to a complicated area of the codebase (anything networking), which is unequivocally a good thing to do. So, thank you for it!
There was a problem hiding this comment.
But uptime wasn't added. It was added in 2023. It was moved from one file to another.
Are we talking past each other?
But, yeah, this definitely ballooned, but leaves it better than we found it.
Description
Removed
UrlEncodethird-party dependency.include/UrlEncode.hproto and new (better) body insrc/network.cpp.Uses RFC 1738 style percent-encoding.
urlEncodefunction and its usage insrc/deviceconfig.cppwith#if ENABLE_WIFI. It may be possible to do better later, but we agree for now that without WIFI, there is no URL.UrlEncode.hfromPatternStocks.handPatternSubscribers.h.Contributing requirements
mainas the target branch.