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

refactor: drop promise utils #6746

Merged
merged 9 commits into from
Sep 21, 2020

Commits on Sep 20, 2020

  1. stop using PromiseUtils.create & extractValue as they're doing nothing

    because we never use PromiseUtils.create, PromiseUtils.extract was technically
    never used either - the only case we were using this was in a test
    where we can replace it with Promise.resolve
    imnotjames committed Sep 20, 2020
    Configuration menu
    Copy the full SHA
    b19a661 View commit details
    Browse the repository at this point in the history
  2. stop using PromiseUtils.settle in test 1014

    there was no reason to use this call in the test
    as it was not using the results and only used the `Promise.all`
    functionality
    imnotjames committed Sep 20, 2020
    Configuration menu
    Copy the full SHA
    15b50cb View commit details
    Browse the repository at this point in the history
  3. use Promise.all instead of PromiseUtils.runInSequence in tests

    in these cases of PromiseUtils.runInSequence in tests there was no need
    for us to be running them in sequence - so instead we could use Promise.all
    & Array.map for a replacement.  removes the dependency on PromiseUtils &
    also speeds up our tests
    imnotjames committed Sep 20, 2020
    Configuration menu
    Copy the full SHA
    1006e6f View commit details
    Browse the repository at this point in the history
  4. run tests sequentially for those that deal with ActiveRecord

    because the activerecord mechanism creates a "global" scope through
    the class that ActiveRecord is applied to we have to run through the
    connections sequentially or end up with them being all over the place
    as far as what activerecord model is connected to what connection
    imnotjames committed Sep 20, 2020
    Configuration menu
    Copy the full SHA
    f7d6c22 View commit details
    Browse the repository at this point in the history
  5. use standard async/await + for/of instead of runInSequence

    in cases where actual order of the runs matter we can do for/of
    and then await any of the results - because none of the usages of
    runInSequence that rely on the correct order actually use the results
    imnotjames committed Sep 20, 2020
    Configuration menu
    Copy the full SHA
    5411938 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    b76384d View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    e87f1cf View commit details
    Browse the repository at this point in the history
  8. sequentially run when dealing with QueryRunner

    queryrunner is not 'thread-safe' or async safe
    imnotjames committed Sep 20, 2020
    Configuration menu
    Copy the full SHA
    bd9a62d View commit details
    Browse the repository at this point in the history
  9. drop the test to lookup by Promise

    before, the test wasn't validating that you could lookup by promise
    the test was verifying that if you used something that wasn't a promise
    but instead had a magic __value__ variable you'd get a lookup
    
    that's not a promise, unfortunately
    
    I can't find that a promise may be passed into the find options anywhere
    in the documentation so I've removed this test
    imnotjames committed Sep 20, 2020
    Configuration menu
    Copy the full SHA
    1cad559 View commit details
    Browse the repository at this point in the history