remove sent-received tracking
This commit is contained in:
parent
e7427997d2
commit
42fe00d5cb
1
.env
1
.env
|
@ -16,6 +16,5 @@ INSTABUG_TOKEN=758630ed52864cbad9c5eeeac596c60c
|
|||
DEBUG_WEBVIEW=1
|
||||
INSTABUG_SURVEYS=1
|
||||
GROUP_CHATS_ENABLED=0
|
||||
FORCE_SENT_RECEIVED_TRACKING=0
|
||||
USE_SYM_KEY=0
|
||||
SPAM_BUTTON_DETECTION_ENABLED=1
|
1
.env.e2e
1
.env.e2e
|
@ -16,5 +16,4 @@ INSTABUG_TOKEN=758630ed52864cbad9c5eeeac596c60c
|
|||
DEBUG_WEBVIEW=1
|
||||
INSTABUG_SURVEYS=0
|
||||
GROUP_CHATS_ENABLED=1
|
||||
FORCE_SENT_RECEIVED_TRACKING=0
|
||||
USE_SYM_KEY=0
|
||||
|
|
|
@ -16,7 +16,6 @@ INSTABUG_TOKEN=758630ed52864cbad9c5eeeac596c60c
|
|||
DEBUG_WEBVIEW=1
|
||||
INSTABUG_SURVEYS=1
|
||||
GROUP_CHATS_ENABLED=0
|
||||
FORCE_SENT_RECEIVED_TRACKING=1
|
||||
USE_SYM_KEY=0
|
||||
SPAM_BUTTON_DETECTION_ENABLED=1
|
||||
MAINNET_WARNING_ENABLED=1
|
||||
|
|
|
@ -16,6 +16,5 @@ INSTABUG_TOKEN=758630ed52864cbad9c5eeeac596c60c
|
|||
DEBUG_WEBVIEW=1
|
||||
INSTABUG_SURVEYS=1
|
||||
GROUP_CHATS_ENABLED=0
|
||||
FORCE_SENT_RECEIVED_TRACKING=1
|
||||
SPAM_BUTTON_DETECTION_ENABLED=1
|
||||
MAINNET_WARNING_ENABLED=1
|
||||
|
|
|
@ -17,6 +17,5 @@ INSTABUG_TOKEN=758630ed52864cbad9c5eeeac596c60c
|
|||
DEBUG_WEBVIEW=0
|
||||
INSTABUG_SURVEYS=1
|
||||
GROUP_CHATS_ENABLED=0
|
||||
FORCE_SENT_RECEIVED_TRACKING=0
|
||||
USE_SYM_KEY=0
|
||||
MAINNET_WARNING_ENABLED=1
|
||||
|
|
|
@ -102,9 +102,7 @@
|
|||
[context]
|
||||
(let [new-db (get-coeffect context :db)
|
||||
[event-name] (get-coeffect context :event)]
|
||||
(when (or
|
||||
(mixpanel/force-tracking? event-name)
|
||||
(get-in new-db [:account/account :sharing-usage-data?]))
|
||||
(when (get-in new-db [:account/account :sharing-usage-data?])
|
||||
(let [event (get-coeffect context :event)
|
||||
offline? (or (= :offline (:network-status new-db))
|
||||
(= :offline (:sync-state new-db)))
|
||||
|
|
|
@ -135,8 +135,3 @@
|
|||
[(update trigger :properties merge data)]
|
||||
(map (partial update trigger :properties merge) data)))
|
||||
[trigger]))))))
|
||||
|
||||
(defn force-tracking? [event-name]
|
||||
(and config/force-sr-ratio-tracking
|
||||
(contains? #{:signals/envelope-status :chat-received-message/add}
|
||||
event-name)))
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
(ns status-im.utils.mixpanel-events
|
||||
(:require [status-im.chat.models.message :as message-model]))
|
||||
(ns status-im.utils.mixpanel-events)
|
||||
;; This file is supposed to be edited by Chad.
|
||||
;; Chad loves mixpanel. When Chad was a child he dreamed of being a mixpanel tamer.
|
||||
|
||||
|
@ -197,44 +196,4 @@
|
|||
{:label "Tap"
|
||||
:trigger [:my-profile/finish]
|
||||
:properties {:target :seed-phrase
|
||||
:type :step3-done}}
|
||||
|
||||
;; sent/receive ratio
|
||||
{:label "SRratio"
|
||||
:trigger [:signals/envelope-status]
|
||||
:properties {:target :user-message-sent}
|
||||
:filter-fn (fn [db [_ envelope-hash status]]
|
||||
(when (= :sent status)
|
||||
(let [{:keys [chat-id message-id]}
|
||||
(get-in db [:transport/message-envelopes envelope-hash])
|
||||
|
||||
{:keys [message-type]}
|
||||
(get-in db [:chats chat-id :messages message-id])]
|
||||
(= :user-message message-type))))
|
||||
:data-fn (fn [db [_ envelope-hash status]]
|
||||
(when (= :sent status)
|
||||
(let [{:keys [chat-id message-id]}
|
||||
(get-in db [:transport/message-envelopes envelope-hash])
|
||||
|
||||
{:keys [message-type]}
|
||||
(get-in db [:chats chat-id :messages message-id])]
|
||||
{:message-id message-id
|
||||
:message-type message-type})))}
|
||||
|
||||
{:label "SRratio"
|
||||
:trigger [:chat-received-message/add]
|
||||
:properties {:target :user-message-received}
|
||||
:filter-fn (fn [db [_ messages]]
|
||||
(some
|
||||
(fn [{:keys [message-type] :as message}]
|
||||
(and (= :user-message message-type)
|
||||
(message-model/add-to-chat? {:db db} message)))
|
||||
messages))
|
||||
:data-fn (fn [db [_ messages]]
|
||||
(keep
|
||||
(fn [{:keys [message-id message-type] :as message}]
|
||||
(when (and (= :user-message message-type)
|
||||
(message-model/add-to-chat? {:db db} message))
|
||||
{:message-type message-type
|
||||
:message-id message-id}))
|
||||
messages))}])
|
||||
:type :step3-done}}])
|
||||
|
|
Loading…
Reference in New Issue