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

Omit erroneous overview elements #1393

Merged
merged 5 commits into from
Apr 15, 2024
Merged

Omit erroneous overview elements #1393

merged 5 commits into from
Apr 15, 2024

Conversation

iamacook
Copy link
Member

Summary

This filters the return array of the Safe overview endpoint (/v1/safes), removing any elements that threw. This prevents one thrown retrieval of a SafeOverview from blocking others.

Changes

  • Change request from Promise.all to Promise.allSettled
  • Filter out 'rejected' elements, logging if existent

@iamacook iamacook self-assigned this Apr 11, 2024
@iamacook iamacook marked this pull request as ready for review April 11, 2024 09:57
@iamacook iamacook requested a review from a team as a code owner April 11, 2024 09:57
@coveralls
Copy link

coveralls commented Apr 11, 2024

Pull Request Test Coverage Report for Build 8686808883

Details

  • 11 of 11 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.08%) to 93.019%

Totals Coverage Status
Change from base Build 8644939672: 0.08%
Covered Lines: 6768
Relevant Lines: 7021

💛 - Coveralls

it('forwards error responses from the Config Service', async () => {
const chain = chainBuilder().with('chainId', '10').build();
const safeInfo = safeBuilder().build();
it('omits erroroneous Safes on chains returning an error from the Config Service', async () => {
Copy link
Member

Choose a reason for hiding this comment

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

Nit: erroneous

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed in 56fee09.

it('forwards error responses from the Transaction Service', async () => {
const chain = chainBuilder().with('chainId', '10').build();
const safeInfo = safeBuilder().build();
it('omits erroroneous Safes from the Transaction Service', async () => {
Copy link
Member

Choose a reason for hiding this comment

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

Nit: erroneous

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed in 56fee09.

const tokenAddress = faker.finance.ethereumAddress();
const secondTokenAddress = faker.finance.ethereumAddress();
const transactionApiBalancesResponse = [
it('omits erroroneous Safes validation of the Transaction Service return Promise.rejects', async () => {
Copy link
Member

Choose a reason for hiding this comment

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

Nit: erroneous

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed in 56fee09.

@hectorgomezv
Copy link
Member

Superb job! I've left a tiny nit thing only.

@iamacook iamacook changed the title Omit errorneous overview elements Omit erroneous overview elements Apr 12, 2024
@fmrsabino fmrsabino added the in review Someone is reviewing this Pull Request label Apr 15, 2024
src/routes/safes/safes.service.ts Outdated Show resolved Hide resolved
@fmrsabino fmrsabino removed the in review Someone is reviewing this Pull Request label Apr 15, 2024
@iamacook iamacook requested a review from fmrsabino April 15, 2024 09:33
@iamacook iamacook merged commit cf5978a into main Apr 15, 2024
16 checks passed
@iamacook iamacook deleted the omit-errorneous-overviews branch April 15, 2024 09:44
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.

None yet

4 participants