Skip to content

Commit 0c06cc0

Browse files
Merge pull request #1334 from Instabug/feat/network-spans-filtering
upgrade: native Android & iOS snapshots to 14.1.0
2 parents 5f42520 + a2818b0 commit 0c06cc0

File tree

12 files changed

+198
-95
lines changed

12 files changed

+198
-95
lines changed

android/native.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
project.ext.instabug = [
2-
version: '14.0.0.6273368-SNAPSHOT'
2+
version: '14.1.0.6273967-SNAPSHOT'
33
]
44

55
dependencies {

examples/default/android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ buildscript {
2424
classpath("com.android.tools.build:gradle:8.1.0")
2525
classpath("com.facebook.react:react-native-gradle-plugin")
2626
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
27-
classpath("com.instabug.library:instabug-plugin:14.0.0.6273368-SNAPSHOT")
27+
classpath("com.instabug.library:instabug-plugin:14.1.0.6273967-SNAPSHOT")
2828
}
2929
}
3030

examples/default/ios/Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ target 'InstabugExample' do
1919
rn_maps_path = '../node_modules/react-native-maps'
2020
pod 'react-native-google-maps', :path => rn_maps_path
2121

22-
pod 'Instabug', :podspec => 'https://ios-releases.instabug.com/custom/release-support_cp_network_filtering_obfuscation-add_reset_network_state/13.4.3/Instabug.podspec'
22+
pod 'Instabug', :podspec => 'https://ios-releases.instabug.com/custom/feature-support_cp_network_filtering_obfuscation-base/14.1.0/Instabug.podspec'
2323
use_react_native!(
2424
:path => config[:reactNativePath],
2525
# An absolute path to your application root.

examples/default/ios/Podfile.lock

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ PODS:
3131
- hermes-engine (0.75.4):
3232
- hermes-engine/Pre-built (= 0.75.4)
3333
- hermes-engine/Pre-built (0.75.4)
34-
- Instabug (13.4.3)
34+
- Instabug (14.1.0)
3535
- instabug-reactnative-ndk (0.1.0):
3636
- DoubleConversion
3737
- glog
@@ -1603,7 +1603,7 @@ PODS:
16031603
- ReactCommon/turbomodule/core
16041604
- Yoga
16051605
- RNInstabug (13.4.0):
1606-
- Instabug (= 13.4.3)
1606+
- Instabug (= 14.1.0)
16071607
- React-Core
16081608
- RNReanimated (3.16.1):
16091609
- DoubleConversion
@@ -1747,7 +1747,7 @@ DEPENDENCIES:
17471747
- fmt (from `../node_modules/react-native/third-party-podspecs/fmt.podspec`)
17481748
- glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`)
17491749
- hermes-engine (from `../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec`)
1750-
- Instabug (from `https://ios-releases.instabug.com/custom/release-support_cp_network_filtering_obfuscation-add_reset_network_state/13.4.3/Instabug.podspec`)
1750+
- Instabug (from `https://ios-releases.instabug.com/custom/feature-support_cp_network_filtering_obfuscation-base/14.1.0/Instabug.podspec`)
17511751
- instabug-reactnative-ndk (from `../node_modules/instabug-reactnative-ndk`)
17521752
- OCMock
17531753
- RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`)
@@ -1844,7 +1844,7 @@ EXTERNAL SOURCES:
18441844
:podspec: "../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec"
18451845
:tag: hermes-2024-08-15-RNv0.75.1-4b3bf912cc0f705b51b71ce1a5b8bd79b93a451b
18461846
Instabug:
1847-
:podspec: https://ios-releases.instabug.com/custom/release-support_cp_network_filtering_obfuscation-add_reset_network_state/13.4.3/Instabug.podspec
1847+
:podspec: https://ios-releases.instabug.com/custom/feature-support_cp_network_filtering_obfuscation-base/14.1.0/Instabug.podspec
18481848
instabug-reactnative-ndk:
18491849
:path: "../node_modules/instabug-reactnative-ndk"
18501850
RCT-Folly:
@@ -1995,7 +1995,7 @@ SPEC CHECKSUMS:
19951995
Google-Maps-iOS-Utils: f77eab4c4326d7e6a277f8e23a0232402731913a
19961996
GoogleMaps: 032f676450ba0779bd8ce16840690915f84e57ac
19971997
hermes-engine: ea92f60f37dba025e293cbe4b4a548fd26b610a0
1998-
Instabug: 12ea6990039094c48a7c7e8103ba8679c0833f5e
1998+
Instabug: afe23192d5487aa2afd4f3baa76913cc2c421cda
19991999
instabug-reactnative-ndk: d765ac289d56e8896398d02760d9abf2562fc641
20002000
OCMock: 589f2c84dacb1f5aaf6e4cec1f292551fe748e74
20012001
RCT-Folly: 4464f4d875961fce86008d45f4ecf6cef6de0740
@@ -2061,14 +2061,14 @@ SPEC CHECKSUMS:
20612061
ReactCommon: 6a952e50c2a4b694731d7682aaa6c79bc156e4ad
20622062
RNCClipboard: 2821ac938ef46f736a8de0c8814845dde2dcbdfb
20632063
RNGestureHandler: 511250b190a284388f9dd0d2e56c1df76f14cfb8
2064-
RNInstabug: 514b187e5b884939fd337eefb3244ea75e7e34f8
2064+
RNInstabug: 6e109844b6a8cb6d905e3dacd644973839862715
20652065
RNReanimated: f42a5044d121d68e91680caacb0293f4274228eb
20662066
RNScreens: c7ceced6a8384cb9be5e7a5e88e9e714401fd958
20672067
RNSVG: 8b1a777d54096b8c2a0fd38fc9d5a454332bbb4d
20682068
RNVectorIcons: 6382277afab3c54658e9d555ee0faa7a37827136
20692069
SocketRocket: abac6f5de4d4d62d24e11868d7a2f427e0ef940d
2070-
Yoga: aa3df615739504eebb91925fc9c58b4922ea9a08
2070+
Yoga: 055f92ad73f8c8600a93f0e25ac0b2344c3b07e6
20712071

2072-
PODFILE CHECKSUM: 784fde5e5fa833eeefea8a5deaa699d18167d101
2072+
PODFILE CHECKSUM: 48043b3d903923ac80ca4e335406e87f2daba40f
20732073

2074-
COCOAPODS: 1.15.2
2074+
COCOAPODS: 1.14.0

examples/default/src/App.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import Instabug, {
77
CrashReporting,
88
InvocationEvent,
99
LogLevel,
10+
NetworkInterceptionMode,
1011
NetworkLogger,
1112
ReproStepsMode,
1213
} from 'instabug-reactnative';
@@ -29,7 +30,7 @@ export const App: React.FC = () => {
2930
token: '0fcc87b8bf731164828cc411eccc802a',
3031
invocationEvents: [InvocationEvent.floatingButton],
3132
debugLogsLevel: LogLevel.verbose,
32-
// networkInterceptionMode: NetworkInterceptionMode.native,
33+
networkInterceptionMode: NetworkInterceptionMode.native,
3334
});
3435

3536
CrashReporting.setNDKCrashesEnabled(true);

ios/native.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$instabug = { :version => '13.4.3' }
1+
$instabug = { :version => '14.1.0' }
22

33
def use_instabug! (spec = nil)
44
version = $instabug[:version]

src/modules/Instabug.ts

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
//todo: remove all logs tagged with 'Andrew' in the file
21
import {
32
AppState,
43
type AppStateStatus,
@@ -74,25 +73,6 @@ function reportCurrentViewForAndroid(screenName: string | null) {
7473
}
7574
}
7675

77-
function _logFlags() {
78-
if (Platform.OS === 'android') {
79-
console.log(
80-
`Andrew: APM Flags -> {
81-
isNativeInterceptionFeatureEnabled: ${isNativeInterceptionFeatureEnabled},
82-
hasAPMNetworkPlugin: ${hasAPMNetworkPlugin},
83-
shouldEnableNativeInterception: ${shouldEnableNativeInterception}
84-
}`,
85-
);
86-
} else {
87-
console.log(
88-
`Andrew: APM Flags -> {
89-
isNativeInterceptionFeatureEnabled: ${isNativeInterceptionFeatureEnabled},
90-
shouldEnableNativeInterception: ${shouldEnableNativeInterception}
91-
}`,
92-
);
93-
}
94-
}
95-
9676
/**
9777
* Initializes the SDK.
9878
* This is the main SDK method that does all the magic. This is the only
@@ -148,14 +128,11 @@ const handleAppStateChange = async (nextAppState: AppStateStatus, config: Instab
148128
const isUpdated = await fetchApmNetworkFlags();
149129

150130
if (isUpdated) {
151-
console.log('Andrew: App has come to the foreground!');
152-
console.log('Andrew: APM network flags updated.');
153131
refreshAPMNetworkConfigs(config);
154132
}
155133
}
156134

157135
_currentAppState = nextAppState;
158-
console.log(`Andrew: Current AppState: ${_currentAppState}`);
159136
};
160137

161138
/**
@@ -176,10 +153,6 @@ const fetchApmNetworkFlags = async () => {
176153
isUpdated = true;
177154
}
178155
}
179-
180-
console.log(
181-
`Andrew: fetchApmNetworkFlags {isNativeInterceptionFeatureEnabled: ${isNativeInterceptionFeatureEnabled}, hasAPMNetworkPlugin: ${hasAPMNetworkPlugin}}`,
182-
);
183156
return isUpdated;
184157
};
185158

@@ -241,13 +214,6 @@ function handleAndroidNativeInterception() {
241214
* Control either to enable or disable the native interception for iOS after the init method is called.
242215
*/
243216
function handleIOSNativeInterception(config: InstabugConfig) {
244-
console.log(
245-
`Andrew: handleIOSNativeInterception(${
246-
shouldEnableNativeInterception &&
247-
config.networkInterceptionMode === NetworkInterceptionMode.native
248-
})`,
249-
);
250-
251217
if (
252218
shouldEnableNativeInterception &&
253219
config.networkInterceptionMode === NetworkInterceptionMode.native
@@ -295,12 +261,6 @@ const handleInterceptionModeForIOS = (config: InstabugConfig) => {
295261
* Initializes Instabug with the given configuration.
296262
*/
297263
const initializeNativeInstabug = (config: InstabugConfig) => {
298-
console.log(
299-
`Andrew: initializeNativeInstabug -> NativeNetworkInterceptionMode ${
300-
shouldEnableNativeInterception &&
301-
config.networkInterceptionMode === NetworkInterceptionMode.native
302-
}`,
303-
);
304264
NativeInstabug.init(
305265
config.token,
306266
config.invocationEvents,
@@ -319,7 +279,6 @@ function refreshAPMNetworkConfigs(config: InstabugConfig, forceRefreshIOS: boole
319279
if (Platform.OS === 'ios' && forceRefreshIOS) {
320280
handleIOSNativeInterception(config);
321281
}
322-
_logFlags();
323282
setApmNetworkFlagsIfChanged({
324283
isNativeInterceptionFeatureEnabled,
325284
hasAPMNetworkPlugin,
@@ -339,10 +298,6 @@ function refreshAPMNetworkConfigs(config: InstabugConfig, forceRefreshIOS: boole
339298
function addOnFeatureUpdatedListener(config: InstabugConfig) {
340299
emitter.addListener(NativeEvents.IBG_ON_FEATURES_UPDATED_CALLBACK, (flags) => {
341300
const { cpNativeInterceptionEnabled, hasAPMPlugin } = flags;
342-
console.log(`Andrew: addOnFeatureUpdatedListener ->
343-
isNativeInterceptionFeatureEnabled: ${cpNativeInterceptionEnabled},
344-
hasAPMNetworkPlugin: ${hasAPMPlugin}.
345-
`);
346301
isNativeInterceptionFeatureEnabled = cpNativeInterceptionEnabled;
347302
hasAPMNetworkPlugin = hasAPMPlugin;
348303
shouldEnableNativeInterception =

src/modules/NetworkLogger.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,6 @@ export const setEnabled = (isEnabled: boolean) => {
4141
try {
4242
if (_networkDataObfuscationHandler) {
4343
network = await _networkDataObfuscationHandler(network);
44-
console.log(
45-
`Andrew: xhr.setOnDoneCallback -> _networkDataObfuscationHandler ${network.url}`,
46-
);
4744
}
4845

4946
if (network.requestBodySize > InstabugConstants.MAX_NETWORK_BODY_SIZE_IN_BYTES) {
@@ -88,7 +85,6 @@ export const setEnabled = (isEnabled: boolean) => {
8885
* @param isEnabled
8986
*/
9087
export const setNativeInterceptionEnabled = (isEnabled: boolean) => {
91-
console.log(`Andrew: NetworkLogger -> setNativeInterceptionEnabled ${isEnabled}`);
9288
_isNativeInterceptionEnabled = isEnabled;
9389
};
9490

@@ -108,12 +104,8 @@ export const setNetworkDataObfuscationHandler = (
108104
_networkDataObfuscationHandler = handler;
109105
if (_isNativeInterceptionEnabled && Platform.OS === 'ios') {
110106
if (hasFilterExpression) {
111-
console.log(
112-
'Andrew: setNetworkDataObfuscationHandler -> registerFilteringAndObfuscationListenerV2',
113-
);
114107
registerFilteringAndObfuscationListener(_requestFilterExpression);
115108
} else {
116-
console.log('Andrew: setNetworkDataObfuscationHandler -> registerObfuscationListener');
117109
registerObfuscationListener();
118110
}
119111
}
@@ -129,12 +121,8 @@ export const setRequestFilterExpression = (expression: string) => {
129121

130122
if (_isNativeInterceptionEnabled && Platform.OS === 'ios') {
131123
if (_networkDataObfuscationHandler) {
132-
console.log(
133-
'Andrew: setRequestFilterExpression -> registerFilteringAndObfuscationListenerV2',
134-
);
135124
registerFilteringAndObfuscationListener(_requestFilterExpression);
136125
} else {
137-
console.log('Andrew: setRequestFilterExpression -> registerFilteringListener');
138126
registerFilteringListener(_requestFilterExpression);
139127
}
140128
}
@@ -186,11 +174,8 @@ export const registerNetworkLogsListener = (
186174
handler?: (networkSnapshot: NetworkData) => void,
187175
) => {
188176
if (Platform.OS === 'ios') {
189-
console.log('Andrew: registerNetworkLogsListener called');
190-
191177
// remove old listeners
192178
if (NetworkLoggerEmitter.listenerCount(NativeNetworkLoggerEvent.NETWORK_LOGGER_HANDLER) > 0) {
193-
console.log('Andrew: removeAllListeners called');
194179
NetworkLoggerEmitter.removeAllListeners(NativeNetworkLoggerEvent.NETWORK_LOGGER_HANDLER);
195180
}
196181

@@ -201,7 +186,6 @@ export const registerNetworkLogsListener = (
201186
// attach a new listener to the existing one.
202187
_networkListener = NetworkListenerType.both;
203188
}
204-
console.log(`Andrew: new NetworkLogsListener (${_networkListener}) attached`);
205189
}
206190

207191
NetworkLoggerEmitter.addListener(

src/utils/AppStatesHandler.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ let subscription: any = null;
66
export const addAppStateListener = (handleAppStateChange: (state: AppStateStatus) => void) => {
77
if (!subscription) {
88
subscription = AppState.addEventListener('change', handleAppStateChange);
9-
console.log('Andrew: AppState listener added');
109
}
1110
};
1211

@@ -16,6 +15,5 @@ export const removeAppStateListener = () => {
1615
if (subscription) {
1716
subscription.remove();
1817
subscription = null;
19-
console.log('Andrew: AppState listener removed');
2018
}
2119
};

src/utils/InstabugUtils.ts

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -171,15 +171,11 @@ export function isContentTypeNotAllowed(contentType: string) {
171171
return allowed.every((type) => !contentType.includes(type));
172172
}
173173

174-
//todo: remove all logs tagged with 'Andrew' in the file
175174
export const reportNetworkLog = (network: NetworkData) => {
176175
if (Platform.OS === 'android') {
177176
const requestHeaders = JSON.stringify(network.requestHeaders);
178177
const responseHeaders = JSON.stringify(network.responseHeaders);
179178

180-
console.log('Andrew: ' + `NetworkLogger -> ${JSON.stringify(apmFlags)}`);
181-
console.log('Andrew: ' + 'NetworkLogger -> NativeInstabug.networkLogAndroid');
182-
183179
NativeInstabug.networkLogAndroid(
184180
network.url,
185181
network.requestBody,
@@ -196,8 +192,6 @@ export const reportNetworkLog = (network: NetworkData) => {
196192
!apmFlags.hasAPMNetworkPlugin ||
197193
!apmFlags.shouldEnableNativeInterception
198194
) {
199-
console.log('Andrew: ' + 'NetworkLogger -> NativeAPM.networkLogAndroid');
200-
console.log('Andrew: ' + `NetworkLogger -> ${network.url}`);
201195
NativeAPM.networkLogAndroid(
202196
network.startTime,
203197
network.duration,
@@ -218,12 +212,6 @@ export const reportNetworkLog = (network: NetworkData) => {
218212
);
219213
}
220214
} else {
221-
console.log(
222-
'Andrew: ' +
223-
`NetworkLogger -> {isNativeInterceptionEnabled: ${apmFlags.isNativeInterceptionFeatureEnabled}}`,
224-
);
225-
console.log('Andrew: ' + 'NetworkLogger -> NativeInstabug.networkLogIOS');
226-
227215
NativeInstabug.networkLogIOS(
228216
network.url,
229217
network.method,
@@ -245,6 +233,10 @@ export const reportNetworkLog = (network: NetworkData) => {
245233
}
246234
};
247235

236+
/**
237+
* @internal
238+
* This method is for internal use only.
239+
*/
248240
export function registerObfuscationListener() {
249241
NetworkLogger.registerNetworkLogsListener(
250242
NetworkListenerType.obfuscation,
@@ -258,6 +250,10 @@ export function registerObfuscationListener() {
258250
);
259251
}
260252

253+
/**
254+
* @internal
255+
* This method is for internal use only.
256+
*/
261257
export function registerFilteringListener(filterExpression: string) {
262258
NetworkLogger.registerNetworkLogsListener(
263259
NetworkListenerType.filtering,
@@ -279,6 +275,10 @@ export function registerFilteringListener(filterExpression: string) {
279275
);
280276
}
281277

278+
/**
279+
* @internal
280+
* This method is for internal use only.
281+
*/
282282
export function registerFilteringAndObfuscationListener(filterExpression: string) {
283283
NetworkLogger.registerNetworkLogsListener(NetworkListenerType.both, async (networkSnapshot) => {
284284
// eslint-disable-next-line no-new-func
@@ -304,14 +304,14 @@ export function registerFilteringAndObfuscationListener(filterExpression: string
304304
});
305305
}
306306

307+
/**
308+
* @internal
309+
* This method is for internal use only.
310+
*/
307311
export function checkNetworkRequestHandlers() {
308312
const obfuscationHandler = NetworkLogger.getNetworkDataObfuscationHandler();
309313
const hasFilterExpression = NetworkLogger.hasRequestFilterExpression();
310314

311-
console.log(
312-
`Andrew: handlers
313-
{filtering = ${hasFilterExpression}, obfuscation = ${obfuscationHandler != null}}`,
314-
);
315315
if (hasFilterExpression && obfuscationHandler) {
316316
// Register listener that handles both (Filtering & Obfuscation)
317317
registerFilteringAndObfuscationListener(NetworkLogger.getRequestFilterExpression());
@@ -336,7 +336,11 @@ export function resetNativeObfuscationListener() {
336336
NetworkLoggerEmitter.removeAllListeners(NativeNetworkLoggerEvent.NETWORK_LOGGER_HANDLER);
337337
}
338338

339-
function updateNetworkLogSnapshot(networkSnapshot: NetworkData) {
339+
/**
340+
* @internal
341+
* This method is for internal use only.
342+
*/
343+
export function updateNetworkLogSnapshot(networkSnapshot: NetworkData) {
340344
NativeNetworkLogger.updateNetworkLogSnapshot(
341345
networkSnapshot.url,
342346
networkSnapshot.id,

0 commit comments

Comments
 (0)