Skip to content

Commit

Permalink
fix: showing datadog label in support mail - WPB-15997 (#2501)
Browse files Browse the repository at this point in the history
Co-authored-by: François Benaiteau <[email protected]>
  • Loading branch information
github-actions[bot] and netbe authored Feb 12, 2025
1 parent c482c3f commit be487a5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 18 deletions.
4 changes: 2 additions & 2 deletions WireAnalytics/Sources/WireDatadog/WireFakeDatadog.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ public import WireLogging

public final class WireDatadog {

public var userIdentifier: String {
""
public var userIdentifier: String? {
nil
}

public init(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ struct LogFilesProvider: LogFilesProviding {
return url
}

private func createInfoFile(at url: URL) throws -> URL {
var info: String {
let date = Date()

var body = """
Expand All @@ -159,10 +159,13 @@ struct LogFilesProvider: LogFilesProviding {
// display only when enabled
body.append("\nDatadog ID: \(datadogUserIdentifier)")
}
return body
}

private func createInfoFile(at url: URL) throws -> URL {
let infoFileURL = url.appendingPathComponent("info.txt")

try body.write(
try info.write(
to: infoFileURL,
atomically: true,
encoding: .utf8
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,12 @@ import WireSystem
extension MFMailComposeViewController {

func prefilledBody(withMessage message: String = "") -> String {
let date = Date()
let device = UIDevice.current.zm_model()

var body = """
--DO NOT EDIT--
App Version: \(Bundle.main.appInfo.fullVersion)
Bundle id: \(Bundle.main.bundleIdentifier ?? "-")
Device: \(device)
iOS version: \(UIDevice.current.systemVersion)
Date: \(date.transportString())
\(LogFilesProvider().info)
---------------\n
"""

if let datadogUserIdentifier = WireAnalytics.Datadog.userIdentifier {
// display only when enabled
body.append("\nDatadog ID: \(datadogUserIdentifier)")
}

body.append("\n---------------\n")
typealias l10n = L10n.Localizable.Self.Settings.TechnicalReport.MailBody
let details = """
\(l10n.firstline)
Expand Down

0 comments on commit be487a5

Please sign in to comment.