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

RUM-5174 Fix attributes objc interop #1933

Conversation

0xnm
Copy link
Member

@0xnm 0xnm commented Jul 1, 2024

What and why?

All the attributes coming from ObjC API are wrapped into AnyEncodable

return attributes.mapValues { AnyEncodable($0) }
. It means that we cannot get raw attribute value when getting it by key, we need to unwrap it.

How?

Wrap objc attribute in AnyEncodable only if the type is not already Encodable.

Review checklist

  • Feature or bugfix MUST have appropriate tests (unit, integration)
  • Make sure each commit and the PR mention the Issue number or JIRA reference
  • Add CHANGELOG entry for user facing changes

Custom CI job configuration (optional)

  • Run unit tests for Session Replay

@0xnm 0xnm force-pushed the nogorodnikov/rum-5174/command-attributes-coming-from-objc-api-are-not-unwrapped-correctly branch from eff0096 to db97f71 Compare July 1, 2024 16:01
@maxep maxep force-pushed the nogorodnikov/rum-5174/command-attributes-coming-from-objc-api-are-not-unwrapped-correctly branch from db97f71 to 03759f0 Compare July 2, 2024 10:54
@maxep maxep force-pushed the nogorodnikov/rum-5174/command-attributes-coming-from-objc-api-are-not-unwrapped-correctly branch from 03759f0 to a6b7e5c Compare July 2, 2024 10:56
@maxep maxep marked this pull request as ready for review July 2, 2024 10:59
@maxep maxep requested review from a team as code owners July 2, 2024 10:59
@maxep maxep changed the title RUM-5174: Correctly unwrap internal attributes coming from Objective-C API RUM-5174 Fix attributes objc interop Jul 2, 2024
@0xnm 0xnm merged commit 4919d00 into develop Jul 2, 2024
14 checks passed
@maxep maxep deleted the nogorodnikov/rum-5174/command-attributes-coming-from-objc-api-are-not-unwrapped-correctly branch July 2, 2024 17:46
@maciejburda maciejburda mentioned this pull request Jul 10, 2024
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants