Skip to content

Comments

feat(Session Replay): RedactOptions#3842

Merged
brustolin merged 11 commits intofeat/experimental-optionsfrom
feat(SR)/masking-options
Apr 10, 2024
Merged

feat(Session Replay): RedactOptions#3842
brustolin merged 11 commits intofeat/experimental-optionsfrom
feat(SR)/masking-options

Conversation

@brustolin
Copy link
Contributor

Add options to enable or disabled redaction for session replay.

#skip-changelog

@github-actions
Copy link
Contributor

github-actions bot commented Apr 9, 2024

Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against a9b7bd5

@codecov
Copy link

codecov bot commented Apr 9, 2024

Codecov Report

Attention: Patch coverage is 35.89744% with 25 lines in your changes are missing coverage. Please review.

Project coverage is 89.049%. Comparing base (e715ec0) to head (a9b7bd5).

Additional details and impacted files

Impacted file tree graph

@@                       Coverage Diff                       @@
##           feat/experimental-options     #3842       +/-   ##
===============================================================
- Coverage                     89.052%   89.049%   -0.004%     
===============================================================
  Files                            556       556               
  Lines                          60379     60408       +29     
  Branches                       21663     21680       +17     
===============================================================
+ Hits                           53769     53793       +24     
+ Misses                          5670      5557      -113     
- Partials                         940      1058      +118     
Files Coverage Δ
Sources/Sentry/SentryOptions.m 97.698% <ø> (ø)
...tegrations/SessionReplay/SentryReplayOptions.swift 76.000% <100.000%> (+7.578%) ⬆️
...tions/SessionReplay/SentrySessionReplayTests.swift 98.000% <100.000%> (ø)
Sources/Sentry/SentryEnvelope.m 87.958% <50.000%> (-0.812%) ⬇️
Sources/Sentry/SentrySessionReplay.m 85.380% <60.000%> (-0.848%) ⬇️
Sources/Swift/Tools/SentryViewPhotographer.swift 14.117% <0.000%> (ø)

... and 38 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e715ec0...a9b7bd5. Read the comment docs.

@github-actions
Copy link
Contributor

github-actions bot commented Apr 9, 2024

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1225.59 ms 1250.22 ms 24.64 ms
Size 21.58 KiB 579.57 KiB 557.99 KiB

Baseline results on branch: feat/experimental-options

Startup times

Revision Plain With Sentry Diff
23c1156 1218.55 ms 1242.84 ms 24.28 ms
8ba1afe 1232.96 ms 1247.94 ms 14.98 ms
1ca681c 1230.61 ms 1252.46 ms 21.85 ms
42535e4 1231.21 ms 1250.35 ms 19.14 ms
bc9c60d 1235.55 ms 1252.02 ms 16.47 ms
16172e3 1225.07 ms 1241.80 ms 16.73 ms

App size

Revision Plain With Sentry Diff
23c1156 21.58 KiB 577.78 KiB 556.20 KiB
8ba1afe 21.58 KiB 578.58 KiB 557.00 KiB
1ca681c 21.58 KiB 578.08 KiB 556.50 KiB
42535e4 21.58 KiB 577.78 KiB 556.20 KiB
bc9c60d 21.58 KiB 577.78 KiB 556.20 KiB
16172e3 21.58 KiB 577.80 KiB 556.21 KiB

Previous results on branch: feat(SR)/masking-options

Startup times

Revision Plain With Sentry Diff
d71df0c 1232.14 ms 1248.31 ms 16.16 ms
5822059 1212.88 ms 1242.69 ms 29.82 ms
3ed3ea8 1233.80 ms 1236.36 ms 2.57 ms

App size

Revision Plain With Sentry Diff
d71df0c 21.58 KiB 579.21 KiB 557.62 KiB
5822059 21.58 KiB 579.10 KiB 557.52 KiB
3ed3ea8 21.58 KiB 579.10 KiB 557.52 KiB

Copy link
Member

@philipphofmann philipphofmann left a comment

Choose a reason for hiding this comment

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

A few comments.

Comment on lines +23 to +28
/**
* Indicates whether session replay should redact all text in the app
* by drawing a black rectangle over it.
*
* - note: The default is true
*/
Copy link
Member

Choose a reason for hiding this comment

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

m: Swift comments should be like this if I'm not mistaken

/// Emits a Counter metric.
///
/// - Parameter key: A unique key identifying the metric.
/// - Parameter value: The value to be added.
/// - Parameter unit: The value for the metric see `MeasurementUnit`.
/// - Parameter tags: Tags to associate with the metric.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The way I did work, I tried.
image

But we can choose which way we prefer.

Copy link
Member

Choose a reason for hiding this comment

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

Hmm, I got this from Alamofire. I don't mind.

import Foundation

@objc
protocol SentryRedactOptions {
Copy link
Member

Choose a reason for hiding this comment

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

m: I don't get why we need that interface. Please explain.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Decoupling.

If we continue along the current path, where everything depends on everything else, it will be impossible to make any major changes in the future.

I am trying to be a responsible engineer and adopting protocols-oriented programming, as suggested by Apple when Swift was released.
I will create a document for us to discuss swift architecture since we're in the beginning.
Also, this approach is highly beneficial for testing purposes. We no longer need to override a class with a multitude of behaviors; instead, we simply need to implement the protocol

Copy link
Member

Choose a reason for hiding this comment

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

It's great you care about decoupling. What are you decoupling with this interface?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

SentryViewPhotographer to have a dependency on sentryreplayoptions,
SentryViewPhotographer will also be used for screenshot integration later.

Base automatically changed from feat(SR)/maximumduration to feat/experimental-options April 10, 2024 08:41
Copy link
Member

@philipphofmann philipphofmann left a comment

Choose a reason for hiding this comment

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

LGTM, I don't mind the extra protocol for now.

@brustolin brustolin merged commit b3b32b8 into feat/experimental-options Apr 10, 2024
@brustolin brustolin deleted the feat(SR)/masking-options branch April 10, 2024 12:49
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