-
-
Notifications
You must be signed in to change notification settings - Fork 654
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix a regression from #4235. #4265
Conversation
`fetchWithAuth`'s implementation is very short, and we don't use it anywhere except `apiFetch`, so it already seems wise just to inline it. We're also about to shorten `apiFetch` by using a URL computation instead of string concatenation (for zulip#4146), which will make an even stronger case for inlining `fetchWithAuth`.
2e0fe44
to
365e669
Compare
Thanks! About to merge.
I think this isn't a problem with
|
For zulip#4146, but also to fix a recent regression from 865914f. The URL constructor already throws a special "Invalid URL" error if it can't put together a valid URL from the inputs, so, nicely, we get to remove the `isValidUrl` call site. There was a double-forward-slash issue in this string concatenation: the realm gained a trailing slash with the round-trip through `new URL(…).toString()` from 865914f, and we kept the leading slash in what we were adding to the end of the realm.
And use a URL computation instead, which is what we do elsewhere. In particular, it's how we check whether we can store the realm in Redux, so it's good to make the UI align with that. This helper function is a relic from the days before zulip#4081 and zulip#4146, so it should disappear anyway. It was the sole user of an NPM package. So, uninstall that.
Thanks for the review and merge! |
It seems likely that this line has the same issue, then, in the Apple auth flow:
|
Ah, yeah, probably—testing with a fix now. |
OK, just sent #4266. |
There was an accidental duplication of the trailing slash on the realm in all API requests, starting in 865914f. So, fix that and make some more progress toward #4146.