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

Temporary workaround (hotfix): do not call "extendUserAgent" #527

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@multiversx/sdk-core",
"version": "13.14.0",
"version": "13.14.1",
"description": "MultiversX SDK for JavaScript and TypeScript",
"author": "MultiversX",
"homepage": "https://multiversx.com",
Expand Down
1 change: 0 additions & 1 deletion src/networkProviders/apiNetworkProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import { FungibleTokenOfAccountOnNetwork, NonFungibleTokenOfAccountOnNetwork } from "./tokens";
import { TransactionOnNetwork, prepareTransactionForBroadcasting } from "./transactions";
import { TransactionStatus } from "./transactionStatus";
import { extendUserAgent } from "./userAgent";

Check warning on line 21 in src/networkProviders/apiNetworkProvider.ts

View workflow job for this annotation

GitHub Actions / build (16.x)

'extendUserAgent' is defined but never used. Allowed unused vars must match /^_/u

// TODO: Find & remove duplicate code between "ProxyNetworkProvider" and "ApiNetworkProvider".
export class ApiNetworkProvider implements INetworkProvider {
Expand All @@ -34,7 +34,6 @@
this.config = { ...defaultAxiosConfig, ...config };
this.backingProxyNetworkProvider = new ProxyNetworkProvider(url, proxyConfig);
this.axios = getAxios();
extendUserAgent(this.userAgentPrefix, this.config);
}

private getProxyConfig(config: NetworkProviderConfig | undefined) {
Expand Down
6 changes: 3 additions & 3 deletions src/networkProviders/providers.dev.net.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ describe("test network providers on devnet: Proxy and API", function () {
assert.deepEqual(apiResponse, proxyResponse);
});

it("should add userAgent unknown for clientName when no clientName passed", async function () {
it.skip("should add userAgent unknown for clientName when no clientName passed", async function () {
const expectedApiUserAgent = "multiversx-sdk/api/unknown";
const expectedProxyUserAgent = "multiversx-sdk/proxy/unknown";

Expand All @@ -55,7 +55,7 @@ describe("test network providers on devnet: Proxy and API", function () {
assert.equal(localProxyProvider.config.headers.getUserAgent(), expectedProxyUserAgent);
});

it("should set userAgent with specified clientName ", async function () {
it.skip("should set userAgent with specified clientName ", async function () {
const expectedApiUserAgent = "multiversx-sdk/api/test";
const expectedProxyUserAgent = "multiversx-sdk/proxy/test";

Expand All @@ -72,7 +72,7 @@ describe("test network providers on devnet: Proxy and API", function () {
assert.equal(localProxyProvider.config.headers.getUserAgent(), expectedProxyUserAgent);
});

it("should keep the set userAgent and add the sdk to it", async function () {
it.skip("should keep the set userAgent and add the sdk to it", async function () {
const expectedApiUserAgent = "Client-info multiversx-sdk/api/test";
const expectedProxyUserAgent = "Client-info multiversx-sdk/proxy/test";

Expand Down
1 change: 0 additions & 1 deletion src/networkProviders/proxyNetworkProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import { FungibleTokenOfAccountOnNetwork, NonFungibleTokenOfAccountOnNetwork } from "./tokens";
import { TransactionOnNetwork, prepareTransactionForBroadcasting } from "./transactions";
import { TransactionStatus } from "./transactionStatus";
import { extendUserAgent } from "./userAgent";

Check warning on line 18 in src/networkProviders/proxyNetworkProvider.ts

View workflow job for this annotation

GitHub Actions / build (16.x)

'extendUserAgent' is defined but never used. Allowed unused vars must match /^_/u

// TODO: Find & remove duplicate code between "ProxyNetworkProvider" and "ApiNetworkProvider".
export class ProxyNetworkProvider implements INetworkProvider {
Expand All @@ -28,7 +28,6 @@
this.url = url;
this.config = { ...defaultAxiosConfig, ...config };
this.axios = getAxios();
extendUserAgent(this.userAgentPrefix, this.config);
}

async getNetworkConfig(): Promise<NetworkConfig> {
Expand Down
Loading