Skip to content
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

Merged
merged 13 commits into from
Sep 21, 2021

Commits on Sep 21, 2021

  1. Configuration menu
    Copy the full SHA
    b2c3cb9 View commit details
    Browse the repository at this point in the history
  2. accounts [nfc]: Cut unused tryGetCurrentRealm

    This doesn't have any callers.
    gnprice authored and chrisbobbe committed Sep 21, 2021
    Configuration menu
    Copy the full SHA
    1cc2833 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    217ee25 View commit details
    Browse the repository at this point in the history
  4. 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.
    gnprice authored and chrisbobbe committed Sep 21, 2021
    Configuration menu
    Copy the full SHA
    46532fc View commit details
    Browse the repository at this point in the history
  5. 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.
    gnprice authored and chrisbobbe committed Sep 21, 2021
    Configuration menu
    Copy the full SHA
    a1f0dde View commit details
    Browse the repository at this point in the history
  6. outbox [nfc]: Unexport trySendMessages

    This is really just an internal helper for sendOutbox -- the body
    of its retry loop.
    gnprice authored and chrisbobbe committed Sep 21, 2021
    Configuration menu
    Copy the full SHA
    9dfdcc4 View commit details
    Browse the repository at this point in the history
  7. 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.
    gnprice authored and chrisbobbe committed Sep 21, 2021
    Configuration menu
    Copy the full SHA
    e26539c View commit details
    Browse the repository at this point in the history
  8. 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.
    gnprice authored and chrisbobbe committed Sep 21, 2021
    Configuration menu
    Copy the full SHA
    838133a View commit details
    Browse the repository at this point in the history
  9. 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.
    gnprice authored and chrisbobbe committed Sep 21, 2021
    Configuration menu
    Copy the full SHA
    e6d81b8 View commit details
    Browse the repository at this point in the history
  10. sharing [nfc]: Stop taking dispatch, no longer used here

    This 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.
    gnprice authored and chrisbobbe committed Sep 21, 2021
    Configuration menu
    Copy the full SHA
    ebbd1ca View commit details
    Browse the repository at this point in the history
  11. redux types [nfc]: Cut disused PlainDispatch

    We haven't needed this since we upgraded off of react-navigation v1,
    in 98836b8 two years ago.
    gnprice authored and chrisbobbe committed Sep 21, 2021
    Configuration menu
    Copy the full SHA
    cafeebe View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    41848b3 View commit details
    Browse the repository at this point in the history
  13. react-redux types: Add more $ReadOnly

    These are all bags of React props, so they should indeed be read-only
    object types.
    gnprice authored and chrisbobbe committed Sep 21, 2021
    Configuration menu
    Copy the full SHA
    e19f9cd View commit details
    Browse the repository at this point in the history