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

feat(nfts): add nfts owned to redux #3902

Merged
merged 24 commits into from
Jun 30, 2023
Merged

feat(nfts): add nfts owned to redux #3902

merged 24 commits into from
Jun 30, 2023

Conversation

MuckT
Copy link
Collaborator

@MuckT MuckT commented Jun 22, 2023

Description

Adds users owned NFTs to redux to allow for image cache hits: enabled via feature flag.

Test plan

  • Add Saga Tests
    • Succesful load
    • Error load
    • Feature flag enabled / disabled
  • Add redux migration test
  • Existing tests updated

Related issues

Backwards compatibility

Yes

@codecov
Copy link

codecov bot commented Jun 22, 2023

Codecov Report

Merging #3902 (2abbc2d) into main (f84ce0d) will decrease coverage by 0.01%.
The diff coverage is 72.22%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3902      +/-   ##
==========================================
- Coverage   82.27%   82.26%   -0.01%     
==========================================
  Files         708      710       +2     
  Lines       26289    26342      +53     
  Branches     3584     3584              
==========================================
+ Hits        21630    21671      +41     
- Misses       4596     4608      +12     
  Partials       63       63              
Impacted Files Coverage Δ
src/redux/store.ts 82.25% <ø> (ø)
src/statsig/constants.ts 100.00% <ø> (ø)
src/nfts/slice.ts 40.00% <40.00%> (ø)
src/redux/sagas.ts 47.57% <50.00%> (+0.04%) ⬆️
src/nfts/saga.ts 82.75% <82.75%> (ø)
src/redux/migrations.ts 98.16% <100.00%> (+<0.01%) ⬆️
src/redux/reducers.ts 94.44% <100.00%> (+0.15%) ⬆️
src/statsig/types.ts 100.00% <100.00%> (ø)
src/web3/networkConfig.ts 100.00% <100.00%> (ø)
test/schemas.ts 97.59% <100.00%> (+0.01%) ⬆️

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Sentry.

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

@MuckT MuckT marked this pull request as ready for review June 22, 2023 07:09
@MuckT MuckT mentioned this pull request Jun 23, 2023
3 tasks
src/nfts/saga.ts Outdated
Accept: 'application/json',
},
})
if (!response.ok) yield put(fetchNftsFailed({ error: 'Could not fetch NFTs' }))
Copy link
Contributor

@dievazqu dievazqu Jun 23, 2023

Choose a reason for hiding this comment

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

Shouldn't we throw here? And the catch will handle it.
Maybe we can include some data from the failed response in the message. I think response.status and response.statusText are nice to have.

Also, it's a good practice to always include the { }.

Copy link
Collaborator Author

@MuckT MuckT Jun 23, 2023

Choose a reason for hiding this comment

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

The structure was recommended in #3908 (comment). I'll add in the brackets.

Copy link
Collaborator

Choose a reason for hiding this comment

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

i think you should throw here, it will land in the catch block so you don't need to duplicate the error handling (calling fetchNftsFailed twice)

MuckT and others added 3 commits June 23, 2023 14:28
# Conflicts:
#	src/redux/migrations.test.ts
#	src/redux/migrations.ts
#	src/redux/store.test.ts
#	src/redux/store.ts
#	src/web3/networkConfig.ts
#	test/schemas.ts
Copy link
Contributor

@dievazqu dievazqu left a comment

Choose a reason for hiding this comment

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

LGTM! 👏

src/nfts/saga.ts Outdated Show resolved Hide resolved
@MuckT MuckT enabled auto-merge (squash) June 30, 2023 19:59
@MuckT MuckT merged commit 0aa13ed into main Jun 30, 2023
15 checks passed
@MuckT MuckT deleted the tomm/nft-gallery-0 branch June 30, 2023 22:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants