WeTransfer / Diagnostics

Allow users to easily share Diagnostics with your support team to improve the flow of fixing bugs.
MIT License
933 stars 53 forks source link

Add Privacy Manifest #171

Closed peagasilva closed 2 months ago

peagasilva commented 2 months ago

This PR adds a privacy manifest file and makes a few improvements along the way.

This is a breaking change around UserDefaultsReporter, making sure that we are using it matching the privacy requirements. Because of these changes, UserDefaultsReporter is not part of the DefaultReporter.allReporters, requiring for users of the library to instantiate a UserDefaultsReporter themselves if they would like to use this reporter.

The main change is on how we're using UserDefaultsReporter internally to use UserDefaults. We decided to keep UserDefaultsReporter to make it less of a breaking change to the developers using Diagnostics, instead of removing it completely.

Before the changes, we were using the dictionaryRepresentation() in the UserDefaults instance, which would return everything contained in there. With the changes, we are now acting as wrapper, where the new API requires a UserDefaults instance and an array of keys that should be read from the given instance, so we iterate over the keys and fetch each of them individually. This allows us to use C56D.1 for the UserDefaults reason.

For more information around the privacy manifest file, please refer to Privacy manifest files.

Fixes TMOB-5314, #157 and #168.

wetransferplatform commented 2 months ago
Messages
:book: DiagnosticsTests: Executed 35 tests (0 failed, 0 retried, 0 skipped) in 11.574 seconds
:book: Slowest test: DiagnosticsReporterTests/testReportingChapters() (2.014s)
:book: Slowest test: DiagnosticsReporterTests/testWithoutProvidingSmartInsightsProvider() (2.006s)
:book: Slowest test: DiagnosticsReporterTests/testWithSmartInsightsProviderReturningExtraInsights() (2.005s)
:book: View more details on Bitrise

Code Coverage Report

Name Coverage
Diagnostics 62.96% ⚠️

Generated by :no_entry_sign: Danger Swift against 82f8539a2c85d8443cba20985b376e39d07f54ee