-
-
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
redux: Various small prep changes for multi-org support #5016
Commits on Sep 21, 2021
-
Configuration menu - View commit details
-
Copy full SHA for b2c3cb9 - Browse repository at this point
Copy the full SHA b2c3cb9View commit details -
accounts [nfc]: Cut unused tryGetCurrentRealm
This doesn't have any callers.
Configuration menu - View commit details
-
Copy full SHA for 1cc2833 - Browse repository at this point
Copy the full SHA 1cc2833View commit details -
Configuration menu - View commit details
-
Copy full SHA for 217ee25 - Browse repository at this point
Copy the full SHA 217ee25View commit details -
presence [nfc]: Drop a tryGetAuth for plain getAuth, like other actions
This thunk action reportPresence is in much the same situation as most of our other thunk actions: it's meant to act on a single account's data; it acts on the active account's data; it has a bug where if the active account changes while its network request is pending, it can apply the response to the wrong account's data; and it can't do much if there is no logged-in active account. It had been unusual in that it checked at the top for a logged-in active account, and bailed out silently if there was none. That's because it's unusual in that it's called from a spot that starts operating before the user logs in, and keeps operating if they log out. But ever since we overhauled the presence-reporting code in 6efc449, that caller (PresenceHeartbeat) already checks whether there's a logged-in active account, and only invokes this action if there is. So it can go ahead and make that assumption exactly the same way that the bulk of our thunk actions do. That will simplify bringing it along with the rest when we make them act on a specific account they're dispatched for. Also add a couple of related notes for that future migration.
Configuration menu - View commit details
-
Copy full SHA for 46532fc - Browse repository at this point
Copy the full SHA 46532fcView commit details -
account [nfc]: Strength-reduce various getActiveAccount calls
All of these are in per-account contexts: the main UI, or a server fetch (indeed the initial fetch.) None of them need the whole Account object. That object includes the API key, which is a good reason not to pass it around where we can avoid it; and it has both the user's identity on the server and miscellaneous bits like the server version, which might get rearranged to separate places in the future, so it's convenient to put those through separate indirections like getIdentity and getServerVersion.
Configuration menu - View commit details
-
Copy full SHA for a1f0dde - Browse repository at this point
Copy the full SHA a1f0ddeView commit details -
outbox [nfc]: Unexport trySendMessages
This is really just an internal helper for sendOutbox -- the body of its retry loop.
Configuration menu - View commit details
-
Copy full SHA for 9dfdcc4 - Browse repository at this point
Copy the full SHA 9dfdcc4View commit details -
presence [nfc]: Make choice of newUserInput explicit; add TODO
I don't really know what this parameter means, so can't evaluate if false is the right value for it. The history doesn't seem to be enlightening; we've had it this way since early on. Also make the other argument `isActive` non-optional. The existing call site passes a value for it explicitly, and this will keep it that way.
Configuration menu - View commit details
-
Copy full SHA for e26539c - Browse repository at this point
Copy the full SHA e26539cView commit details -
redux [nfc]: Drop some redundant Dispatch / GetState annotations
These are all module-private helpers that get these parameter's types inferred from their callers. (Those callers ultimately get the types via ThunkAction.) We'll be changing the definition of ThunkAction, and it's helpful to have fewer redundant references that need to be updated at the same time.
Configuration menu - View commit details
-
Copy full SHA for 838133a - Browse repository at this point
Copy the full SHA 838133aView commit details -
redux types [nfc]: Inline away GetState
We've just eliminated all the other references to this. We used to have them all over our thunk actions. We recently switched to annotating those with ThunkAction, and we've just gone and eliminated the remaining references, which were on thunk-action-like helpers.
Configuration menu - View commit details
-
Copy full SHA for e6d81b8 - Browse repository at this point
Copy the full SHA e6d81b8View commit details -
sharing [nfc]: Stop taking
dispatch
, no longer used hereThis module hasn't needed a Redux `dispatch` since 543c07c, when we stopped using Redux for dispatching navigation actions. So, simplify by not taking one in the first place.
Configuration menu - View commit details
-
Copy full SHA for ebbd1ca - Browse repository at this point
Copy the full SHA ebbd1caView commit details -
redux types [nfc]: Cut disused PlainDispatch
We haven't needed this since we upgraded off of react-navigation v1, in 98836b8 two years ago.
Configuration menu - View commit details
-
Copy full SHA for cafeebe - Browse repository at this point
Copy the full SHA cafeebeView commit details -
Configuration menu - View commit details
-
Copy full SHA for 41848b3 - Browse repository at this point
Copy the full SHA 41848b3View commit details -
react-redux types: Add more $ReadOnly
These are all bags of React props, so they should indeed be read-only object types.
Configuration menu - View commit details
-
Copy full SHA for e19f9cd - Browse repository at this point
Copy the full SHA e19f9cdView commit details