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: remove axios #1237

Merged
merged 13 commits into from
Jan 18, 2024
Merged

refactor: remove axios #1237

merged 13 commits into from
Jan 18, 2024

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
@@ -76,21 +73,4 @@ describe('persistTransaction', () => {
.set('Accept', 'application/json')
.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.

packages/ethereum-storage/test/ipfs-manager.test.ts Outdated Show resolved Hide resolved
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
Base automatically changed from test/reduce-flaky-tests to master December 19, 2023 11:29
@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
Member

@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
Member

FYI @benjlevesque, the yarn.lock file still references [email protected] that looks unused.

@benjlevesque
Copy link
Contributor Author

@yomarion

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

Copy link
Member

@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! ✨


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

@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
Member

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

packages/request-client.js/test/index.test.ts Outdated Show resolved Hide resolved
@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