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-4150 [SR] Add Activity Indicator Recorder #1934

Merged
merged 9 commits into from
Jul 3, 2024

Conversation

mariedm
Copy link
Member

@mariedm mariedm commented Jul 2, 2024

What and why?

Adding support for UIActivityIndicator in Session Replay.

How?

This PR:

  • creates a new recorder for activity indicators
  • removes activity indicator from unsupported views
  • adds corresponding unit + snapshot tests

image

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

@@ -46,6 +46,8 @@ internal class SnapshotTestCase: XCTestCase {
function: StaticString = #function
) throws {
show(fixture: fixture)
// Give time for the view to appear and lay out properly
wait(seconds: 0.2)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to add this, otherwise the snapshot test suite is failing after adding a new test for the activity indicator recorder. This is a temporary workaround for a known issue.

@mariedm mariedm marked this pull request as ready for review July 2, 2024 15:40
@mariedm mariedm requested review from a team as code owners July 2, 2024 15:40
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think these tests are relevant anymore, it can be removed IMO.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left the last one which still seems useful to test part of the UnsupportedViewRecorder logic with specific ViewControllerType.

Comment on lines 41 to 43
shouldRecordImagePredicate: { imageView in
return imageView.image == nil ? false : true
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/nit

Suggested change
shouldRecordImagePredicate: { imageView in
return imageView.image == nil ? false : true
}
shouldRecordImagePredicate: { $0.image != nil }

/question Are we forcing recording of the image because it is not considered as context image?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, exactly!

maxep
maxep previously approved these changes Jul 3, 2024
Copy link
Member

@maxep maxep left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!!

@mariedm mariedm merged commit dc33648 into develop Jul 3, 2024
15 checks passed
@mariedm mariedm deleted the mariedm/feat/RUM-4150-activity-indicator-recorder branch July 3, 2024 15:37
@maxep maxep mentioned this pull request Jul 4, 2024
4 tasks
@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