-
Notifications
You must be signed in to change notification settings - Fork 23
Remove fromJust usage in URI.Extra.QueryPairs #68
Copy link
Copy link
Open
Labels
status: acceptedThis issue is now ready to be implemented via a PR.This issue is now ready to be implemented via a PR.type: breaking changeA change that requires a major version bump.A change that requires a major version bump.type: bugSomething that should function correctly isn't.Something that should function correctly isn't.
Metadata
Metadata
Assignees
Labels
status: acceptedThis issue is now ready to be implemented via a PR.This issue is now ready to be implemented via a PR.type: breaking changeA change that requires a major version bump.A change that requires a major version bump.type: bugSomething that should function correctly isn't.Something that should function correctly isn't.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Is your change request related to a problem? Please describe.
We ran into a crashing bug in our production front-end where using
printfromURI.Extra.QueryPairswould result in an error which we traced down tofromJustagainstencodeURIComponent's result.Examples:
Both
keyToStringandvalueToStringinURI.Extra.QueryPairswill error if their usage ofencodeURIComponentresults in aNothing. This can happen if unprintable characters. For example aDooli\U001001a9leinside of a string given toencodeURIComponentresults inNothing`.I'm not sure exactly what in the string is causing
encodeURIComponentto return aNothingthere.Describe the solution you'd like
Broadly it'd be nice if usages of
fromJusthere were eliminated entirely. TheMaybeness of the entire API could be represented in its external interface.Alternatively the API could be split into safe and unsafe versions. This is a little tricky since there's already some "unsafe" functions here which are labeled and documented as such for different kinds of safety reasons.
I'm happy to work on a PR but would wanted to get some insight into the appetite for the various solutions to this.
Additional context
In the meantime we're going to mitigate this issue on our end locally by testing our input to the problematic functions against
encodeURIComponentfirst - and possibly by additional input filtering elsewhere in our app.