Skip to content

Commit 3a28d05

Browse files
committed
Temporarily disable Nym mix fetch
1 parent 496b841 commit 3a28d05

3 files changed

Lines changed: 14 additions & 2 deletions

File tree

src/core/plugins/plugins-reducer.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
EdgePluginMap,
66
EdgeSwapPlugin
77
} from '../../types/types'
8+
import { ENABLED_NYM_MIX_FETCH } from '../../util/nym'
89
import { RootAction } from '../actions'
910

1011
export interface PluginsState {
@@ -57,6 +58,14 @@ export const plugins = (
5758
plugin.currencyInfo.displayName
5859
}
5960

61+
if (!ENABLED_NYM_MIX_FETCH) {
62+
const { defaultSettings } = plugin.currencyInfo
63+
if (defaultSettings != null) {
64+
const { networkPrivacy, ...rest } = defaultSettings
65+
plugin.currencyInfo.defaultSettings = rest
66+
}
67+
}
68+
6069
out.currency[pluginId] = plugin
6170
}
6271
if ('swapInfo' in plugin) out.swap[pluginId] = plugin

src/io/react-native/react-native-worker.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import {
1717
EdgeFetchResponse,
1818
EdgeIo
1919
} from '../../types/types'
20-
import { queueMixFetch } from '../../util/nym'
20+
import { ENABLED_NYM_MIX_FETCH, queueMixFetch } from '../../util/nym'
2121
import { hideProperties } from '../hidden-properties'
2222
import { makeNativeBridge } from './native-bridge'
2323
import { WorkerApi, YAOB_THROTTLE_MS } from './react-native-types'
@@ -175,7 +175,7 @@ async function makeIo(logBackend: LogBackend): Promise<EdgeIo> {
175175
): Promise<EdgeFetchResponse> {
176176
const { corsBypass = 'auto', privacy = 'none' } = opts ?? {}
177177

178-
if (privacy === 'nym') {
178+
if (privacy === 'nym' && ENABLED_NYM_MIX_FETCH) {
179179
// Use queued fetch to handle mixFetch's one-request-per-host limitation
180180
// initMixFetch is called within queueMixFetch
181181
const response = await queueMixFetch(

src/util/nym.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ import {
88

99
import { EdgeLog } from '../types/types'
1010

11+
// TODO: Enable this when the NYM mixFetch client is ready for both platforms (iOS and Android)
12+
export const ENABLED_NYM_MIX_FETCH = false
13+
1114
/**
1215
* Configuration options for the NYM mixFetch client.
1316
*/

0 commit comments

Comments
 (0)