-
-
Notifications
You must be signed in to change notification settings - Fork 655
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
Store state.accounts[].realm
as a WHATWG URL object.
#4235
Commits on Sep 22, 2020
-
webview: Prepare to "revive" realm in
handleInitialLoad
.In an upcoming commit, we'll change the `Auth` type to have a URL object for the realm. We call `JSON.stringify` on the arguments passed to `handleInitialLoad`. For the `realm` property, this means it'll be a string URL, not a URL object. Here, we pick it out in preparation for "reviving" it back into its URL form in the body of `handleInitialLoad`.
Configuration menu - View commit details
-
Copy full SHA for c53def3 - Browse repository at this point
Copy the full SHA c53def3View commit details -
store: Replace/revive URL instances.
Like we did in bfe7949, for ZulipVersion instances. We don't store any of these in Redux yet, but we will soon.
Configuration menu - View commit details
-
Copy full SHA for 565e23e - Browse repository at this point
Copy the full SHA 565e23eView commit details -
accounts: Make
Auth.realm
a URL object, including instate.accounts
.Changing the `Auth` type implicitly changes the `Account` and `Identity` types, too. Done with an effort to minimize unnecessary follow-on changes in this commit. Here, we don't propagate the realm in its URL form as far toward the eventual consumers of the realm as we'll eventually want to; we'll do that in upcoming commits. Wherever two realm values are compared for equality with `===`, we make sure they are both stringified first. Flow didn't warn about these cases, so we caught them in test failures and by scanning through a full-project search for the term 'realm'.
Configuration menu - View commit details
-
Copy full SHA for 865914f - Browse repository at this point
Copy the full SHA 865914fView commit details -
webAuth: Pipe
Account[0].realm
as URL down toauthFromCallbackUrl
.As we'll do in some upcoming commits, stringify the realm exactly where we need it as a string. This slightly expands the area of our codebase in which it's easy to see that the realm is well-formed data.
Configuration menu - View commit details
-
Copy full SHA for a3a8317 - Browse repository at this point
Copy the full SHA a3a8317View commit details -
react: Pipe
Account[].realm
as URL to some React-component consumers.As in the previous and next commits, stringify the realm exactly where we need it as a string. This slightly expands the area of our codebase in which it's easy to see that the realm is well-formed data.
Configuration menu - View commit details
-
Copy full SHA for e5972a2 - Browse repository at this point
Copy the full SHA e5972a2View commit details -
avatar: Pipe
Account[0].realm
as URL down togetAvatarUrl
.As in the previous and next commits, stringify the realm exactly where we need it as a string. This slightly expands the area of our codebase in which it's easy to see that the realm is well-formed data. `getAvatarUrl` itself will likely disappear soon, when we make the shell crunchier for handling `.avatar_url` on users, cross-realm bots, and messages. But the changes we make to its callers, here, will continue to be beneficial after that.
Configuration menu - View commit details
-
Copy full SHA for c852dd8 - Browse repository at this point
Copy the full SHA c852dd8View commit details -
getServerSettings: Pipe realm as URL down.
As in the previous and next commits, stringify the realm exactly where we need it as a string. This slightly expands the area of our codebase in which it's easy to see that the realm is well-formed data. Also rename `this.state.realm` to `this.state.realmInputValue`, to be more descriptive.
Configuration menu - View commit details
-
Copy full SHA for d04af75 - Browse repository at this point
Copy the full SHA d04af75View commit details -
url, internalLinks: Pipe realm as URL to
isUrlOnRealm
, `getPathsFro……mUrl`. As in the previous and next commits, stringify the realm exactly where we need it as a string. This slightly expands the area of our codebase in which it's easy to see that the realm is well-formed data.
Configuration menu - View commit details
-
Copy full SHA for 458dee2 - Browse repository at this point
Copy the full SHA 458dee2View commit details -
redux: In REALM_ADD and LOGIN_SUCCESS, make
realm
be a URL object.As in the preceding handful of commits, stringify the realm exactly where we need it as a string. These should be the last sites in which it's not totally clear that the realm is well-formed data.
Configuration menu - View commit details
-
Copy full SHA for ed1be64 - Browse repository at this point
Copy the full SHA ed1be64View commit details -
Configuration menu - View commit details
-
Copy full SHA for 05e24ee - Browse repository at this point
Copy the full SHA 05e24eeView commit details