Skip to content

Commit

Permalink
Add missing is_anon to EditAttemptStep
Browse files Browse the repository at this point in the history
  • Loading branch information
tonisevener committed Oct 9, 2024
1 parent 7319828 commit 3d0f9ab
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Wikipedia/Code/EditAttemptFunnel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public final class EditAttemptFunnel {
let app_install_id: String?
let editor_interface: String
let integration: String
let is_anon: Bool
let mw_version: String
let platform: String
let user_editcount: Int
Expand All @@ -39,6 +40,10 @@ public final class EditAttemptFunnel {
case abort = "abort"
}

private var isAnon: Bool {
return !MWKDataStore.shared().authenticationManager.authStateIsPermanent
}

private var isTemp: Bool {
return MWKDataStore.shared().authenticationManager.authStateIsTemporary
}
Expand All @@ -52,7 +57,7 @@ public final class EditAttemptFunnel {

let appInstallID = UserDefaults.standard.wmf_appInstallId

let event = Event(action: action, editing_session_id: "", app_install_id: appInstallID, editor_interface: editorInterface, integration: integrationID, mw_version: "", platform: platform, user_editcount: 0, user_id: userId, user_is_temp: isTemp, version: 1, page_title: pageURL.wmf_title, page_ns: pageURL.namespace?.rawValue, revision_id: revisionId)
let event = Event(action: action, editing_session_id: "", app_install_id: appInstallID, editor_interface: editorInterface, integration: integrationID, is_anon: isAnon, mw_version: "", platform: platform, user_editcount: 0, user_id: userId, user_is_temp: isTemp, version: 1, page_title: pageURL.wmf_title, page_ns: pageURL.namespace?.rawValue, revision_id: revisionId)

let container = EventContainer(event: event)
EventPlatformClient.shared.submit(stream: .editAttempt, event: container, needsMinimal: true)
Expand Down

0 comments on commit 3d0f9ab

Please sign in to comment.