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

[wallet] Refactor leftover thunk to sagas #1388

Merged
merged 40 commits into from
Oct 23, 2019

Conversation

martinvol
Copy link
Contributor

@martinvol martinvol commented Oct 17, 2019

Description

Removes thunk as a dependency and refactored thunks left as sagas.

Tested

Tests were created. Manual test confirm functionality.

Other changes

Related issues

Backwards compatibility

Everything should work as any reducer changed.

@codecov
Copy link

codecov bot commented Oct 18, 2019

Codecov Report

❗ No coverage uploaded for pull request base (master@f5f9fd8). Click here to learn what that means.
The diff coverage is 50.6%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #1388   +/-   ##
=========================================
  Coverage          ?   65.87%           
=========================================
  Files             ?      271           
  Lines             ?     8048           
  Branches          ?      556           
=========================================
  Hits              ?     5302           
  Misses            ?     2632           
  Partials          ?      114
Flag Coverage Δ
#mobile 65.87% <50.6%> (?)
Impacted Files Coverage Δ
packages/mobile/src/sentry/saga.ts 0% <0%> (ø)
packages/mobile/src/sentry/Sentry.ts 0% <0%> (ø)
packages/mobile/src/redux/sagas.ts 0% <0%> (ø)
packages/mobile/src/redux/reducers.ts 100% <100%> (ø)
packages/mobile/src/sentry/actions.ts 100% <100%> (ø)
packages/mobile/src/home/WalletHome.tsx 90% <100%> (ø)
packages/mobile/src/firebase/actions.ts 100% <100%> (ø)
packages/mobile/src/redux/store.ts 100% <100%> (ø)
packages/mobile/src/firebase/notifications.ts 45.71% <36.36%> (ø)
packages/mobile/src/firebase/saga.ts 32.91% <50%> (ø)
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f5f9fd8...6d08406. Read the comment docs.

packages/mobile/src/firebase/firebase.test.ts Outdated Show resolved Hide resolved
packages/mobile/src/firebase/notifications.ts Outdated Show resolved Hide resolved
packages/mobile/src/firebase/notifications.ts Outdated Show resolved Hide resolved
packages/mobile/test/utils.ts Outdated Show resolved Hide resolved
packages/mobile/src/firebase/saga.ts Outdated Show resolved Hide resolved
packages/mobile/src/firebase/saga.ts Outdated Show resolved Hide resolved
@martinvol martinvol changed the title Refactor leftover thunk to sagas [wallet] Refactor leftover thunk to sagas Oct 21, 2019
@martinvol martinvol marked this pull request as ready for review October 21, 2019 15:00
@martinvol martinvol self-assigned this Oct 21, 2019
Copy link
Contributor

@cmcewen cmcewen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

woot woot woot! no more thunk

packages/mobile/src/firebase/firebase.ts Outdated Show resolved Hide resolved
packages/mobile/src/firebase/firebase.ts Show resolved Hide resolved
try {
Logger.info(TAG, `Writing pending request to database`)
const pendingRequestRef = firebase.database().ref(`pendingRequests`)
return pendingRequestRef.push(paymentInfo)
pendingRequestRef.push(paymentInfo)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It returns a ThenableReference (https://firebase.google.com/docs/reference/js/firebase.database.ThenableReference.html), which still has .then and .catch methods - think you should still yield call this imo

@martinvol martinvol assigned jmrossy and unassigned martinvol Oct 23, 2019
Copy link
Contributor

@jmrossy jmrossy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work here!! A few optional comments below :)
Also looks like the tests are failing?

packages/mobile/src/sentry/saga.ts Outdated Show resolved Hide resolved
packages/mobile/src/firebase/firebase.ts Show resolved Hide resolved
packages/mobile/src/firebase/firebase.ts Show resolved Hide resolved
@martinvol martinvol added the automerge Have PR merge automatically when checks pass label Oct 23, 2019
@celo-ci-bot-user celo-ci-bot-user merged commit 73c1d69 into master Oct 23, 2019
@celo-ci-bot-user celo-ci-bot-user deleted the martinvol/git_rid_thunk branch October 23, 2019 15:05
aaronmgdr added a commit that referenced this pull request Oct 24, 2019
* master:
  [Wallet] Wallet can switch between hosted and local node (#1419)
  [Wallet] Prevent error from Avatar when name is missing (#1454)
  [Wallet] Show splash screen until JS is ready on iOS (#1453)
  Use new segment api keys used by both iOS and Android (#1452)
  [Wallet] Don't log all props, which includes i18n (#1445)
  [Helm] Updated the helm package to deploy the upgraded blockscout version (#1129)
  Tiny copy change (#1429)
  [contractkit] SortedOraclesWrapper + tests (#1405)
  [wallet] Refactor leftover thunk to sagas (#1388)
  [Wallet] Fix repeated QR code scanning and related navigation issues (#1439)
  [Wallet] Show the currency values with correct rounding. (#1435)
  [Wallet] Fix firebase initialization error on iOS after reinstalling the app (#1423)
  [Wallet] Use exit on iOS since we can't restart like Android (#1424)
  [Wallet] Update local currency styles and layout (#1325)
  Reset pincode cache if unlock fails (#1430)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Have PR merge automatically when checks pass wallet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Devs SBAT remove redux-thunk from mobile
4 participants