-
Notifications
You must be signed in to change notification settings - Fork 45
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
FIX [#642, RUM-3855]: Android Runtime Error in v2.3.1 for ReadableArray.asFirstPartyHosts() #644
Merged
marco-saia-datadog
merged 1 commit into
develop
from
marcosaia/fix/issue-642-hashmap-to-readablemap
Apr 4, 2024
Merged
FIX [#642, RUM-3855]: Android Runtime Error in v2.3.1 for ReadableArray.asFirstPartyHosts() #644
marco-saia-datadog
merged 1 commit into
develop
from
marcosaia/fix/issue-642-hashmap-to-readablemap
Apr 4, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
marco-saia-datadog
force-pushed
the
marcosaia/fix/issue-642-hashmap-to-readablemap
branch
2 times, most recently
from
March 28, 2024 13:40
6a8e09c
to
83d323c
Compare
0xnm
requested changes
Mar 28, 2024
packages/core/android/src/main/kotlin/com/datadog/reactnative/DdSdkBridgeExt.kt
Outdated
Show resolved
Hide resolved
packages/core/android/src/main/kotlin/com/datadog/reactnative/DdSdkBridgeExt.kt
Outdated
Show resolved
Hide resolved
packages/core/android/src/main/kotlin/com/datadog/reactnative/DdSdkBridgeExt.kt
Outdated
Show resolved
Hide resolved
packages/core/android/src/main/kotlin/com/datadog/reactnative/DdSdkBridgeExt.kt
Outdated
Show resolved
Hide resolved
packages/core/android/src/main/kotlin/com/datadog/reactnative/DdSdkBridgeExt.kt
Show resolved
Hide resolved
packages/core/android/src/main/kotlin/com/datadog/reactnative/DdSdkBridgeExt.kt
Outdated
Show resolved
Hide resolved
packages/core/android/src/main/kotlin/com/datadog/reactnative/DdSdkConfigurationExt.kt
Outdated
Show resolved
Hide resolved
packages/core/android/src/main/kotlin/com/datadog/reactnative/DdSdkConfigurationExt.kt
Outdated
Show resolved
Hide resolved
packages/core/android/src/test/kotlin/com/datadog/reactnative/DdSdkBridgeExtTest.kt
Outdated
Show resolved
Hide resolved
packages/core/android/src/test/kotlin/com/datadog/reactnative/DdSdkBridgeExtTest.kt
Outdated
Show resolved
Hide resolved
marco-saia-datadog
force-pushed
the
marcosaia/fix/issue-642-hashmap-to-readablemap
branch
from
April 3, 2024 13:06
f6ae714
to
800e4c7
Compare
0xnm
reviewed
Apr 3, 2024
packages/core/android/src/main/kotlin/com/datadog/reactnative/DdSdkBridgeExt.kt
Outdated
Show resolved
Hide resolved
packages/core/android/src/main/kotlin/com/datadog/reactnative/DdSdkBridgeExt.kt
Show resolved
Hide resolved
packages/core/android/src/main/kotlin/com/datadog/reactnative/DdSdkBridgeExt.kt
Outdated
Show resolved
Hide resolved
packages/core/android/src/main/kotlin/com/datadog/reactnative/DdSdkBridgeExt.kt
Outdated
Show resolved
Hide resolved
packages/core/android/src/main/kotlin/com/datadog/reactnative/DdSdkBridgeExt.kt
Outdated
Show resolved
Hide resolved
packages/core/android/src/main/kotlin/com/datadog/reactnative/DdSdkConfigurationExt.kt
Show resolved
Hide resolved
packages/core/android/src/test/kotlin/com/datadog/reactnative/DdSdkBridgeExtTest.kt
Show resolved
Hide resolved
packages/core/android/src/test/kotlin/com/datadog/reactnative/DdSdkBridgeExtTest.kt
Outdated
Show resolved
Hide resolved
packages/core/android/src/test/kotlin/com/datadog/reactnative/DdSdkBridgeExtTest.kt
Outdated
Show resolved
Hide resolved
packages/core/android/src/test/kotlin/com/datadog/reactnative/DdSdkBridgeExtTest.kt
Outdated
Show resolved
Hide resolved
marco-saia-datadog
force-pushed
the
marcosaia/fix/issue-642-hashmap-to-readablemap
branch
2 times, most recently
from
April 4, 2024 10:34
0db299c
to
c955537
Compare
marco-saia-datadog
force-pushed
the
marcosaia/fix/issue-642-hashmap-to-readablemap
branch
from
April 4, 2024 10:40
c955537
to
dc35cfa
Compare
0xnm
previously approved these changes
Apr 4, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm! I hope that we add also integration test to check full configuration conversion through the layers.
packages/core/android/src/test/kotlin/com/datadog/reactnative/DdSdkBridgeExtTest.kt
Outdated
Show resolved
Hide resolved
packages/core/android/src/test/kotlin/com/datadog/reactnative/DdSdkBridgeExtTest.kt
Outdated
Show resolved
Hide resolved
marco-saia-datadog
force-pushed
the
marcosaia/fix/issue-642-hashmap-to-readablemap
branch
from
April 4, 2024 11:43
dc35cfa
to
80bd61a
Compare
0xnm
approved these changes
Apr 4, 2024
marco-saia-datadog
force-pushed
the
marcosaia/fix/issue-642-hashmap-to-readablemap
branch
from
April 4, 2024 12:06
80bd61a
to
ebd6552
Compare
marco-saia-datadog
deleted the
marcosaia/fix/issue-642-hashmap-to-readablemap
branch
April 4, 2024 12:26
marco-saia-datadog
changed the title
FIX #642: Android Runtime Error in v2.3.1 for ReadableArray.asFirstPartyHosts()
FIX [#642, RUM-3857]: Android Runtime Error in v2.3.1 for ReadableArray.asFirstPartyHosts()
Apr 4, 2024
marco-saia-datadog
changed the title
FIX [#642, RUM-3857]: Android Runtime Error in v2.3.1 for ReadableArray.asFirstPartyHosts()
FIX [#642, RUM-3855]: Android Runtime Error in v2.3.1 for ReadableArray.asFirstPartyHosts()
Apr 4, 2024
This was referenced Apr 11, 2024
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
ISSUE: #642
INTRODUCED WITH: v2.3.0 in PR #625
Fixes a wrong cast which leads to a Runtime Error.
Details
The tests rely on
JavaOnlyMap
, but its methodtoHashMap
just wraps the map using a HashMap, without converting nested maps and arrays.The
ReadableNativeMap
, which is the one used in a real use case, has a different implementation oftoHashMap
, which recursively converts the nested objects in either stdlib HashMap(s) or ArrayList(s).The error shows up because
.asFirstPartyHosts()
performs an unsafe cast toReadableMap
for the nested objects inside of the array, but the actual type isHashMap
from kotlin stdlib.This PR introduces new conversion functions to ensure that the logic is consistent for different implementations of
ReadableArray
andReadableMap
.Review checklist (to be filled by reviewers)