Closed rkoval closed 1 year ago
Latest commit: ba7c9602b335f2f330a74f73fa5c0942a40cee9e
The changes in this PR will be included in the next version bump.
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
Thank you for your contribution fellow pizza man! 🍕
Hey! Thank you for the contribution, we really appreciate it :D
I did some changes on your PR for formatting/type narrowing to bring it up to merge standard. It is pending testing with our examples repo to ensure it stays consistent in behavior.
I have also done the following:
@guildedjs/rest
release on a semver major increment.In regards to [2] in your footnotes: if we wanted to keep the same functionality but have different signatures so that there isn't incompatible type mix and matching, we could use method overloaders to enforce different, exclusive signatures.
Don't worry about any documentation regarding your changes either, as our TSDoc generator automatically creates new docs files for parsing/hosting on every commit/merge to main.
And a response to [1] as well, the guidelines are clear enough for us to understand. We had actually attempted in the past to conform to the logging standard set in that document, but ran into an issue as we wanted the actual Response
object to also be passed as an object whole into an event on the .emitter
property of the RestManager so that users could have opt-in logging on any REST request, regardless of failure or success. However, we found out it wasn't doable without consuming/cloning the Response object which was not advisable due to thread lockups. As such, we abandoned the attempt and settled on trying again later at some point before the publicization of the API (which we didn't hold ourselves to).
oooh the method overloaders feature of TS is interesting. i think this would've been what i would've wanted had we kept the wonkiness i wrote :). thanks for the tip!
i think the other changes here make sense. thank you for cleaning this up! can you please post a screenshot though of the output from an error just so i can verify what it looks like?
(For record keeping sake, I'll note in this PR that screenshots of the error outputs were sent privately)
Thank you for the contribution! 🚀
Please describe the changes this PR makes and why it should be merged:
Status
Semantic versioning classification:
Yo! Ryan from Guilded Staff here! :pizza:
First of all, thank you so much for your continued interest in Guilded and its bot API!!! We love seeing the passion in the community for building fun stuff against the product. This library has opened the door to JavaScript and TypeScript devs to be able to write bots quickly in these languages. Nice work there!!
This PR serves to bring this library to conformance with the "Verbose Logging" guildeline in Guilded's Bot Library Guidelines document. We have been having trouble working through various support issues recently in our community server for this library, and I think a lot of the pain points come from missing some details from the "Verbose Logging" [1]. From the brief look I took, it does look like this library conforms to the other guidelines in that doc though, so nice work otherwise!!
Some outstanding issues with this PR that I will hand off to the library maintainers to fix (mostly done in the interest of time, sorry for wall of text!):
authorization
header due because I don't know how this library handles case sensitivity of the header given the underlying object is a POJO, not aHeaders
object. This must be done before merging, as it's a security risk outputting it as-is. There are loud FIXMEs explaining whereany
, etc.)!instanceof
checks. It's possible nothing is needed here?I encourage you to prioritize fixing the outstanding issues, merging the PR, and creating a new release so that the Guilded support team can better help debugging various API issues going forward. Please let me know how I can help in facilitating a quick turnaround here.
(msg: string, methodOrRequest: RequestOptions, pathOrResponse: ResponseDetails)
or v1 way in(msg: string, methodOrRequest: string, pathOrResponse: string, code: number)
. This is in contrast with what is currently written that technically allows for mixing and matching of parameters such that you could invoke it like(msg: string, methodOrRequest: string, pathOrResponse: ResponseDetails)
, which is somewhere in between V1 and V2 usage and is bad.