8000 Redact netId values from breakage (#1835) · xpcom-bsd/Android-1@dd16e7a · GitHub
[go: up one dir, main page]

Skip to content

Commit dd16e7a

Browse files
authored
Redact netId values from breakage (duckduckgo#1835)
Task/Issue URL: https://app.asana.com/0/414730916066338/1202050072225379/f ### Description Remove the `netId` value from breakage ### Steps to test this PR - [x] intall from this branch - [x] launch app and enable AppTP - [x] report breakage for any app - [x] verify the breakage_metadata -> networkInfo -> currentNetwork contains `netId` set to -999
1 parent 453a97c commit dd16e7a

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

vpn/src/main/java/com/duckduckgo/mobile/android/vpn/bugreport/NetworkTypeCollector.kt

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,17 @@ class NetworkTypeCollector @Inject constructor(
209209
private fun getNetworkInfoJsonObject(): JSONObject {
210210
updateSecondsSinceLastSwitch()
211211
// redact the lastSwitchTimestampMillis from the report
212-
val info = currentNetworkInfo?.let { adapter.toJson(adapter.fromJson(it)?.copy(lastSwitchTimestampMillis = -999)) } ?: return JSONObject()
212+
val info = currentNetworkInfo?.let {
213+
// Redact some values (set to -999) as they could be static values
214+
val temp = adapter.fromJson(it)
215+
adapter.toJson(
216+
temp?.copy(
217+
lastSwitchTimestampMillis = -999,
218+
currentNetwork = temp.currentNetwork.copy(netId = -999),
219+
previousNetwork = temp.previousNetwork?.copy(netId = -999)
220+
)
221+
)
222+
} ?: return JSONObject()
213223

214224
return JSONObject(info)
215225
}

0 commit comments

Comments
 (0)
0