Skip to content

Conversation

@benjlevesque
Copy link
Contributor

@benjlevesque benjlevesque commented Nov 13, 2023

Motivation

  • reduce size (minor impact)
  • avoid versions conflicts
  • reduce maintenance

Changing to MSW for mocks also has the benefit to be compatible with any client.

Choices

  • Dropping gas-price-definer. This is never used, since feat!: drop legacy storage #1117
  • dropping IpfsStore.read. This is never used.
  • remove maxSize from IpfsManager.read. This method is kept as a convenience, as it's useful to test the read after upload, but is no longer used (since feat!: drop legacy storage #1117).
  • axios remains a devDependency of smart-contracts and toolbox for now

@benjlevesque benjlevesque changed the title refactor/remove axios build(deps): Bump axios from 0.27.2 to 1.6.0 refactor: remove axios Nov 13, 2023
@benjlevesque benjlevesque changed the title build(deps): Bump axios from 0.27.2 to 1.6.0 refactor: remove axios refactor: remove axios Nov 13, 2023
.expect(StatusCodes.INTERNAL_SERVER_ERROR);
});

it('should catch IPFS timeout error', async () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I decided to remove this test. it's a bit hard to replicate and I feel it has no real value

Copy link
Member

Choose a reason for hiding this comment

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

I disagree with this. The Request Node still writes to IPFS but it should fail gracefully if for some reason that write fails.

Comment on lines -187 to -190
expect(config.headers[httpConfigDefaults.requestClientVersionHeader]).toBe(
packageJson.version,
);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I ditched that test, I don't really see the intention

@benjlevesque benjlevesque changed the base branch from master to test/reduce-flaky-tests November 28, 2023 16:17
@benjlevesque benjlevesque force-pushed the test/reduce-flaky-tests branch from d30f9c0 to d27db26 Compare November 29, 2023 10:10
@benjlevesque benjlevesque force-pushed the test/reduce-flaky-tests branch from 9dec3a3 to a2642ac Compare December 19, 2023 11:22
Base automatically changed from test/reduce-flaky-tests to master December 19, 2023 11:29
@benjlevesque benjlevesque force-pushed the refactor/remove-axios branch from 0def2ba to b7df198 Compare January 17, 2024 14:42
@coveralls
Copy link

coveralls commented Jan 17, 2024

Coverage Status

coverage: 86.667% (-0.5%) from 87.128%
when pulling 8e03773 on refactor/remove-axios
into 45d1f5b on master.

Copy link
Contributor

@yomarion yomarion left a comment

Choose a reason for hiding this comment

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

Nice

@yomarion
Copy link
Contributor

FYI @benjlevesque, the yarn.lock file still references axios@0.27.2 that looks unused.

@benjlevesque
Copy link
Contributor Author

@yomarion

  • axios remains a devDependency of smart-contracts and toolbox for now

Copy link
Contributor

@alexandre-abrioux alexandre-abrioux left a comment

Choose a reason for hiding this comment

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

nice! ✨

mockServer.close();
});

it('specify the Request Client version in the header', async () => {
Copy link
Contributor

@alexandre-abrioux alexandre-abrioux Jan 17, 2024

Choose a reason for hiding this comment

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

I couldn't find where we assert in this test that the client version is passed down in the headers. Is the test name wrong, or is this assertion missing?

Copy link
Member

Choose a reason for hiding this comment

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

What was the conclusion here?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it was a typo and it was renamed back to the original name. cc @benjlevesque can you confirm?

Copy link
Contributor Author

@benjlevesque benjlevesque Jan 22, 2024

Choose a reason for hiding this comment

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

yes, sorry my comment remained "pending":

good catch. Probably a bad merge or copy paste, I removed that test

but in the meantime I also added back a check on the version header

@benjlevesque benjlevesque enabled auto-merge (squash) January 18, 2024 10:12
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.

5 participants