diff --git a/fiddle/src/fiddle/views/screens.cljs b/fiddle/src/fiddle/views/screens.cljs index 22fa3c462f5e..ec420648ff9f 100644 --- a/fiddle/src/fiddle/views/screens.cljs +++ b/fiddle/src/fiddle/views/screens.cljs @@ -5,13 +5,12 @@ [status-im.ui.screens.wallet.add-new.views :as add-new] [fiddle.frame :as frame])) -;:generate-key -;:choose-key -;:select-key-storage -;:create-code -;:confirm-code -;:enable-fingerprint -;:enable-notifications +;;:generate-key +;;:choose-key +;;:select-key-storage +;;:create-code +;;:confirm-code +;;:enable-fingerprint (re-frame/reg-sub :intro-wizard (fn [_] {:step :generate-key :generating-keys? false})) (defn screens [] @@ -21,4 +20,4 @@ [frame/frame [intro/wizard]] [frame/frame - [add-new/add-account]]]) \ No newline at end of file + [add-new/add-account]]]) diff --git a/src/status_im/chat/models/message.cljs b/src/status_im/chat/models/message.cljs index 0ff9c6f71f08..7aa2c7df1521 100644 --- a/src/status_im/chat/models/message.cljs +++ b/src/status_im/chat/models/message.cljs @@ -12,7 +12,6 @@ [status-im.ethereum.core :as ethereum] [status-im.mailserver.core :as mailserver] [status-im.native-module.core :as status] - [status-im.notifications.core :as notifications] [status-im.transport.message.group-chat :as message.group-chat] [status-im.transport.message.protocol :as protocol] [status-im.transport.message.transit :as transit] diff --git a/src/status_im/contact/core.cljs b/src/status_im/contact/core.cljs index 10eeb75fa2b5..8c57f72a915d 100644 --- a/src/status_im/contact/core.cljs +++ b/src/status_im/contact/core.cljs @@ -4,7 +4,7 @@ [status-im.multiaccounts.model :as multiaccounts.model] [status-im.transport.filters.core :as transport.filters] [status-im.contact.db :as contact.db] - [status-im.contact.device-info :as device-info] + [status-im.ethereum.core :as ethereum] [status-im.data-store.contacts :as contacts-store] [status-im.mailserver.core :as mailserver] @@ -43,13 +43,10 @@ (defn- own-info [db] - (let [{:keys [name preferred-name photo-path address]} (:multiaccount db) - fcm-token (get-in db [:notifications :fcm-token])] + (let [{:keys [name preferred-name photo-path address]} (:multiaccount db)] {:name (or preferred-name name) :profile-image photo-path - :address address - :device-info (device-info/all {:db db}) - :fcm-token fcm-token})) + :address address})) (fx/defn upsert-contact [{:keys [db] :as cofx} @@ -105,7 +102,7 @@ [{{:contacts/keys [contacts] :as db} :db :as cofx} public-key timestamp - {:keys [name profile-image address fcm-token device-info] :as m}] + {:keys [name profile-image address] :as m}] ;; We need to convert to timestamp ms as before we were using now in ms to ;; set last updated ;; Using whisper timestamp mostly works but breaks in a few scenarios: @@ -121,7 +118,7 @@ (let [contact (get contacts public-key) ;; Backward compatibility with <= 0.9.21, as they don't send - ;; fcm-token & address in contact updates + ;; address in contact updates contact-props (cond-> {:public-key public-key :photo-path profile-image @@ -129,14 +126,9 @@ :address (or address (:address contact) (ethereum/public-key->address public-key)) - :device-info (device-info/merge-info - timestamp - (:device-info contact) - device-info) :last-updated timestamp-ms :system-tags (conj (get contact :system-tags #{}) - :contact/request-received)} - fcm-token (assoc :fcm-token fcm-token))] + :contact/request-received)})] (upsert-contact cofx contact-props))))) (fx/defn initialize-contacts [cofx] @@ -182,4 +174,3 @@ {:events [:contacts/ens-names-verified]} [{:keys [db]} names] {:db (update db :contacts/contacts add-ens-names names)}) - diff --git a/src/status_im/contact/db.cljs b/src/status_im/contact/db.cljs index 864d3e6fb2d5..f024285f77b7 100644 --- a/src/status_im/contact/db.cljs +++ b/src/status_im/contact/db.cljs @@ -11,7 +11,6 @@ ;;Contact (spec/def :contact/address (spec/nilable :global/address)) -(spec/def :contact/fcm-token (spec/nilable string?)) (spec/def :contact/last-online (spec/nilable int?)) (spec/def :contact/last-updated (spec/nilable int?)) (spec/def :contact/name (spec/nilable string?)) @@ -31,8 +30,7 @@ (spec/def :contact/contact (spec/keys :req-un [:contact/address :contact/public-key :contact/system-tags] - :opt-un [:contact/fcm-token - :contact/name + :opt-un [:contact/name :contact/photo-path :contact/last-online :contact/last-updated diff --git a/src/status_im/contact/device_info.cljs b/src/status_im/contact/device_info.cljs deleted file mode 100644 index 96231f28608a..000000000000 --- a/src/status_im/contact/device_info.cljs +++ /dev/null @@ -1,26 +0,0 @@ -(ns status-im.contact.device-info - (:require [status-im.utils.config :as config])) - -(defn all [{:keys [db]}] - (filter - :fcm-token - (conj - (->> (:pairing/installations db) - (vals) - (filter :enabled?) - (filter :fcm-token) - (take config/max-installations) - (map #(hash-map :id (:installation-id %) - :fcm-token (:fcm-token %)))) - {:id (get-in db [:multiaccount :installation-id]) - :fcm-token (get-in db [:notifications :fcm-token])}))) - -(defn merge-info [timestamp previous-devices new-devices] - (reduce (fn [acc {:keys [id] :as new-device}] - (if (:fcm-token new-device) - (assoc acc - id - (assoc new-device :timestamp timestamp)) - acc)) - previous-devices - new-devices)) diff --git a/src/status_im/core.cljs b/src/status_im/core.cljs index 350071ebcf26..91b1c6f5d538 100644 --- a/src/status_im/core.cljs +++ b/src/status_im/core.cljs @@ -3,7 +3,6 @@ [status-im.utils.error-handler :as error-handler] [status-im.utils.platform :as platform] [status-im.ui.components.react :as react] - [status-im.notifications.background :as background-messaging] [reagent.core :as reagent] status-im.transport.impl.receive status-im.transport.impl.send diff --git a/src/status_im/data_store/contacts.cljs b/src/status_im/data_store/contacts.cljs index 7fb041bb0978..4bf50d732ac3 100644 --- a/src/status_im/data_store/contacts.cljs +++ b/src/status_im/data_store/contacts.cljs @@ -6,24 +6,8 @@ [taoensso.timbre :as log] [status-im.utils.types :as types])) -(defn deserialize-device-info [contact] - (update contact :deviceInfo (fn [device-info] - (reduce (fn [acc info] - (assoc acc - (:installationId info) - (clojure.set/rename-keys info {:fcmToken :fcm-token :installationId :id}))) - {} - device-info)))) - -(defn serialize-device-info [contact] - (update contact :device-info (fn [device-info] - (map - #(clojure.set/rename-keys % {:fcm-token :fcmToken :id :installationId}) - (vals device-info))))) - (defn <-rpc [contact] (-> contact - deserialize-device-info (update :tributeToTalk types/deserialize) (update :systemTags #(reduce (fn [acc s] @@ -31,7 +15,6 @@ #{} %)) (clojure.set/rename-keys {:id :public-key :photoPath :photo-path - :deviceInfo :device-info :tributeToTalk :tribute-to-talk :ensVerifiedAt :ens-verified-at :ensVerified :ens-verified @@ -40,14 +23,12 @@ (defn ->rpc [contact] (-> contact - serialize-device-info (update :tribute-to-talk types/serialize) (update :system-tags #(mapv str %)) (clojure.set/rename-keys {:public-key :id :ens-verified :ensVerified :ens-verified-at :ensVerifiedAt :photo-path :photoPath - :device-info :deviceInfo :tribute-to-talk :tributeToTalk :system-tags :systemTags :last-updated :lastUpdated}))) diff --git a/src/status_im/desktop/core.cljs b/src/status_im/desktop/core.cljs index 4ed9a36fa827..9db03b8e7ef9 100644 --- a/src/status_im/desktop/core.cljs +++ b/src/status_im/desktop/core.cljs @@ -7,7 +7,6 @@ status-im.subs [status-im.ui.screens.views :as views] [status-im.ui.components.react :as react] - [status-im.notifications.core :as notifications] [status-im.core :as core] [status-im.utils.snoopy :as snoopy] [status-im.ui.components.desktop.shortcuts :as shortcuts] diff --git a/src/status_im/events.cljs b/src/status_im/events.cljs index 229e4f416f70..f6d921fccb34 100644 --- a/src/status_im/events.cljs +++ b/src/status_im/events.cljs @@ -35,7 +35,6 @@ [status-im.mailserver.constants :as mailserver.constants] [status-im.mailserver.topics :as mailserver.topics] [status-im.node.core :as node] - [status-im.notifications.core :as notifications] [status-im.pairing.core :as pairing] [status-im.privacy-policy.core :as privacy-policy] [status-im.protocol.core :as protocol] @@ -660,23 +659,6 @@ (log/debug :event-str event-str) (signals/process cofx event-str))) -;; notifications module - -(handlers/register-handler-fx - :notifications/notification-open-event-received - (fn [cofx [_ decoded-payload ctx]] - (notifications/handle-push-notification-open cofx decoded-payload ctx))) - -(handlers/register-handler-fx - :notifications.callback/get-fcm-token-success - (fn [{:keys [db]} [_ fcm-token]] - {:db (assoc-in db [:notifications :fcm-token] fcm-token)})) - -(handlers/register-handler-fx - :notifications.callback/on-message - (fn [cofx [_ decoded-payload opts]] - (notifications/handle-on-message cofx decoded-payload opts))) - ;; hardwallet module (handlers/register-handler-fx diff --git a/src/status_im/init/core.cljs b/src/status_im/init/core.cljs index a65dd38fc350..c115b8a992f0 100644 --- a/src/status_im/init/core.cljs +++ b/src/status_im/init/core.cljs @@ -3,7 +3,6 @@ [status-im.multiaccounts.login.core :as multiaccounts.login] [status-im.native-module.core :as status] [status-im.network.net-info :as network] - [status-im.notifications.core :as notifications] [status-im.react-native.js-dependencies :as rn-dependencies] [status-im.ui.screens.db :refer [app-db]] [status-im.ui.screens.navigation :as navigation] @@ -22,34 +21,21 @@ (fx/defn initialize-app-db "Initialize db to initial state" [{{:keys [view-id hardwallet initial-props desktop/desktop - supported-biometric-auth push-notifications/stored network/type]} :db}] + supported-biometric-auth network/type]} :db}] {:db (assoc app-db :initial-props initial-props :desktop/desktop (merge desktop (:desktop/desktop app-db)) :network/type type :hardwallet (dissoc hardwallet :secrets) :supported-biometric-auth supported-biometric-auth - :view-id view-id - :push-notifications/stored stored)}) + :view-id view-id)}) (fx/defn initialize-views [cofx] (let [{{:multiaccounts/keys [multiaccounts] :as db} :db} cofx] (if (empty? multiaccounts) (navigation/navigate-to-cofx cofx :intro nil) - (let [multiaccount-with-notification - (when-not platform/desktop? - (notifications/lookup-contact-pubkey-from-hash - cofx - (first (keys (:push-notifications/stored db))))) - selection-fn - (if (not-empty multiaccount-with-notification) - #(filter (fn [multiaccount] - (= multiaccount-with-notification - (:public-key multiaccount))) - %) - #(sort-by :last-sign-in > %)) - {:keys [address public-key photo-path name]} (first (selection-fn (vals multiaccounts)))] + (let [{:keys [address public-key photo-path name]} (first (#(sort-by :last-sign-in > %) (vals multiaccounts)))] (multiaccounts.login/open-login cofx address photo-path name public-key))))) (fx/defn initialize-multiaccounts @@ -74,7 +60,6 @@ ::restore-native-settings nil ::open-multiaccounts #(re-frame/dispatch [::initialize-multiaccounts %]) :ui/listen-to-window-dimensions-change nil - :notifications/init nil ::network/listen-to-network-info nil :hardwallet/register-card-events nil :hardwallet/check-nfc-support nil @@ -94,4 +79,4 @@ (re-frame/reg-fx ::init-keystore (fn [] - (status/init-keystore))) \ No newline at end of file + (status/init-keystore))) diff --git a/src/status_im/multiaccounts/create/core.cljs b/src/status_im/multiaccounts/create/core.cljs index 884dd7734df3..02306d4165e5 100644 --- a/src/status_im/multiaccounts/create/core.cljs +++ b/src/status_im/multiaccounts/create/core.cljs @@ -24,8 +24,7 @@ :choose-key 2 :select-key-storage 3 :create-code 4 - :confirm-code 5 - :enable-notifications 6}) + :confirm-code 5}) (defn decrement-step [step] (let [inverted (map-invert step-kw-to-num)] @@ -84,22 +83,21 @@ {:events [:intro-wizard/navigate-back]} [{:keys [db] :as cofx} skip-alert?] (let [step (get-in db [:intro-wizard :step])] - ;; Cannot go back after account has been created - ;; and we're on "Enable notifications" step - (when-not (= :enable-notifications step) - (if (and (= step :choose-key) (not skip-alert?)) - (utils/show-question - (i18n/label :t/are-you-sure-to-cancel) - (i18n/label :t/you-will-start-from-scratch) - #(re-frame/dispatch [:intro-wizard/navigate-back true])) - (fx/merge cofx - dec-step - navigation/navigate-back))))) - -(fx/defn exit-wizard [{:keys [db] :as cofx}] + (if (and (= step :choose-key) (not skip-alert?)) + (utils/show-question + (i18n/label :t/are-you-sure-to-cancel) + (i18n/label :t/you-will-start-from-scratch) + #(re-frame/dispatch [:intro-wizard/navigate-back true])) + (fx/merge cofx + dec-step + navigation/navigate-back)))) + +(fx/defn exit-wizard + [{:keys [db] :as cofx}] (fx/merge cofx {:db (dissoc db :intro-wizard)} - (navigation/navigate-to-cofx :home nil))) + (navigation/navigate-reset {:index 0 + :actions [{:routeName :home}]}))) (fx/defn init-key-generation [{:keys [db] :as cofx}] @@ -131,13 +129,9 @@ (cond (confirm-failure? db) (on-confirm-failure cofx) - (or (= step :enable-notifications) - (and (not first-time-setup?) (= step :confirm-code) - (:multiaccounts/login db))) - (fx/merge cofx - (when (and (= step :enable-notifications) (not skip?)) - {:notifications/request-notifications-permissions nil}) - exit-wizard) + (and (= step :confirm-code) + (:multiaccounts/login db)) + (exit-wizard cofx) (= step :generate-key) (init-key-generation cofx) @@ -160,11 +154,7 @@ :step next-step)} (when (= step :create-code) store-key-code) - (when (= next-step :enable-notifications) - (navigation/navigate-reset {:index 0 - :actions [{:routeName :create-multiaccount-enable-notifications}]})) - (when (not= next-step :enable-notifications) - (navigation/navigate-to-cofx (->> next-step name (str "create-multiaccount-") keyword) nil))))))) + (navigation/navigate-to-cofx (->> next-step name (str "create-multiaccount-") keyword) nil)))))) (defn prepare-accounts-data [multiaccount] diff --git a/src/status_im/multiaccounts/login/core.cljs b/src/status_im/multiaccounts/login/core.cljs index 1052d419dc26..36ddb2a2e5d3 100644 --- a/src/status_im/multiaccounts/login/core.cljs +++ b/src/status_im/multiaccounts/login/core.cljs @@ -11,7 +11,6 @@ [status-im.fleet.core :as fleet] [status-im.i18n :as i18n] [status-im.native-module.core :as status] - [status-im.notifications.core :as notifications] [status-im.protocol.core :as protocol] [status-im.stickers.core :as stickers] [status-im.ui.screens.mobile-network-settings.events :as mobile-network] @@ -131,15 +130,14 @@ (fx/defn get-config-callback {:events [::get-config-callback]} - [{:keys [db] :as cofx} config stored-pns] + [{:keys [db] :as cofx} config] (let [[{:keys [address] :as multiaccount} current-network networks] (deserialize-config config) network-id (str (get-in networks [current-network :config :NetworkId]))] (fx/merge cofx {:db (assoc db :networks/current-network current-network :networks/networks networks - :multiaccount multiaccount) - :notifications/request-notifications-permissions nil} + :multiaccount multiaccount)} ;; NOTE: initializing mailserver depends on user mailserver ;; preference which is why we wait for config callback (protocol/initialize-protocol {:default-mailserver true}) @@ -151,14 +149,11 @@ (mobile-network/on-network-status-change) (chaos-mode/check-chaos-mode) (when-not platform/desktop? - (initialize-wallet)) - (when stored-pns - (notifications/process-stored-event address stored-pns))))) + (initialize-wallet))))) (fx/defn login-only-events [{:keys [db] :as cofx} address password save-password?] - (let [stored-pns (:push-notifications/stored db) - auth-method (:auth-method db) + (let [auth-method (:auth-method db) new-auth-method (if save-password? (when-not (or (= "biometric" auth-method) (= "password" auth-method)) (if (= auth-method "biometric-prepare") "biometric" "password")) @@ -178,7 +173,7 @@ :on-success #(re-frame/dispatch [::protocol/initialize-protocol {:mailservers (or % [])}])} {:method "settings_getConfigs" :params [["multiaccount" "current-network" "networks"]] - :on-success #(re-frame/dispatch [::get-config-callback % stored-pns])}]} + :on-success #(re-frame/dispatch [::get-config-callback %])}]} (when save-password? (keychain/save-user-password address password)) (when new-auth-method @@ -243,8 +238,7 @@ :multiaccount)) ::json-rpc/call [{:method "web3_clientVersion" - :on-success #(re-frame/dispatch [::initialize-web3-client-version %])}] - :notifications/get-fcm-token nil} + :on-success #(re-frame/dispatch [::initialize-web3-client-version %])}]} ;;FIXME (when nodes (fleet/set-nodes :eth.contract nodes)) @@ -318,4 +312,4 @@ (fx/merge cofx {:db (assoc-in db [:multiaccounts/login :save-password?] true)} (biometric/show-message bioauth-message bioauth-code) - (open-login-callback nil))))) \ No newline at end of file + (open-login-callback nil))))) diff --git a/src/status_im/multiaccounts/update/core.cljs b/src/status_im/multiaccounts/update/core.cljs index 8a2bc7cf7ac8..b692e6e352cc 100644 --- a/src/status_im/multiaccounts/update/core.cljs +++ b/src/status_im/multiaccounts/update/core.cljs @@ -1,6 +1,6 @@ (ns status-im.multiaccounts.update.core (:require [status-im.contact.db :as contact.db] - [status-im.contact.device-info :as device-info] + [status-im.ethereum.json-rpc :as json-rpc] [status-im.transport.message.contact :as message.contact] [status-im.transport.message.protocol :as protocol] @@ -10,9 +10,8 @@ (fx/defn multiaccount-update-message [{:keys [db] :as cofx}] (let [multiaccount (:multiaccount db) - fcm-token (get-in db [:notifications :fcm-token]) {:keys [name preferred-name photo-path address]} multiaccount] - (message.contact/ContactUpdate. (or preferred-name name) photo-path address fcm-token (device-info/all cofx)))) + (message.contact/ContactUpdate. (or preferred-name name) photo-path address nil nil))) (fx/defn send-multiaccount-update [cofx] (protocol/send diff --git a/src/status_im/pairing/core.cljs b/src/status_im/pairing/core.cljs index 854e752637dd..eb8d73f746fc 100644 --- a/src/status_im/pairing/core.cljs +++ b/src/status_im/pairing/core.cljs @@ -4,7 +4,7 @@ [status-im.chat.models :as models.chat] [status-im.contact.core :as contact] [status-im.contact.db :as contact.db] - [status-im.contact.device-info :as device-info] + [status-im.ethereum.json-rpc :as json-rpc] [status-im.i18n :as i18n] [status-im.multiaccounts.model :as multiaccounts.model] @@ -66,11 +66,10 @@ (sort (partial compare-installation our-installation-id) installations)) (defn pair-installation [cofx] - (let [fcm-token (get-in cofx [:db :notifications :fcm-token]) - installation-id (get-in cofx [:db :multiaccount :installation-id]) + (let [installation-id (get-in cofx [:db :multiaccount :installation-id]) installation-name (get-in cofx [:db :pairing/installations installation-id :name]) device-type utils.platform/os] - (protocol/send (transport.pairing/PairInstallation. installation-id device-type installation-name fcm-token) nil cofx))) + (protocol/send (transport.pairing/PairInstallation. installation-id device-type installation-name nil) nil cofx))) (fx/defn confirm-message-processed [cofx confirmation] @@ -88,11 +87,8 @@ [old-contact new-contact] (sort-by :last-updated [remote local])] (-> local (merge new-contact) - (assoc :device-info (device-info/merge-info (:last-updated new-contact) - (:device-info old-contact) - (vals (:device-info new-contact))) - ;; we only take system tags from the newest contact version - :system-tags (:system-tags new-contact))))) + (assoc ;; we only take system tags from the newest contact version + :system-tags (:system-tags new-contact))))) (def merge-contacts (partial merge-with merge-contact)) @@ -124,11 +120,9 @@ (fx/defn set-name "Set the name of the device" [{:keys [db] :as cofx} installation-name] - (let [fcm-token (get-in cofx [:db :notifications :fcm-token]) - our-installation-id (get-in db [:multiaccount :installation-id])] + (let [our-installation-id (get-in db [:multiaccount :installation-id])] {:pairing/set-installation-metadata [[our-installation-id {:name installation-name - :deviceType utils.platform/os - :fcmToken fcm-token}]]})) + :deviceType utils.platform/os}]]})) (fx/defn init [cofx] {:pairing/get-our-installations nil}) @@ -350,15 +344,12 @@ (confirm-message-processed cofx confirmation)))) (defn handle-pair-installation - [{:keys [db] :as cofx} {:keys [name - fcm-token - installation-id + [{:keys [db] :as cofx} {:keys [nameinstallation-id device-type]} timestamp sender] (if (and (= sender (multiaccounts.model/current-public-key cofx)) (not= (get-in db [:multiaccount :installation-id]) installation-id)) {:pairing/set-installation-metadata [[installation-id {:name name - :deviceType device-type - :fcmToken fcm-token}]]} + :deviceType device-type}]]} (confirm-message-processed cofx (:metadata cofx)))) (fx/defn update-installation [{:keys [db]} installation-id metadata] @@ -366,8 +357,7 @@ assoc :installation-id installation-id :name (:name metadata) - :device-type (:deviceType metadata) - :fcmToken (:fcmToken metadata))}) + :device-type (:deviceType metadata))}) (fx/defn load-installations [{:keys [db]} installations] {:db (assoc db :pairing/installations (reduce @@ -377,7 +367,6 @@ :name (:name metadata) :timestamp (:timestamp metadata) :device-type (:deviceType metadata) - :fcm-token (:fcmToken metadata) :enabled? enabled})) {} installations))}) diff --git a/src/status_im/transport/db.cljs b/src/status_im/transport/db.cljs index cab7fa631f69..48bdd8b1960e 100644 --- a/src/status_im/transport/db.cljs +++ b/src/status_im/transport/db.cljs @@ -20,7 +20,6 @@ :opt-un [:contact/system-tags :contact/last-updated :contact/last-online - :contact/fcm-token :pairing/pending? :contact/tags])) (spec/def :pairing/contacts (spec/nilable (spec/map-of :global/not-empty-string :pairing/contact))) @@ -77,9 +76,9 @@ :message/message-seen :message/message-seen :message/group-membership-update :message/group-membership-update)) -(spec/def :message/contact-request (spec/keys :req-un [:contact/name ::profile-image :contact/address :contact/fcm-token])) -(spec/def :message/contact-update (spec/keys :req-un [:contact/name ::profile-image :contact/address :contact/fcm-token])) -(spec/def :message/contact-request-confirmed (spec/keys :req-un [:contact/name ::profile-image :contact/address :contact/fcm-token])) +(spec/def :message/contact-request (spec/keys :req-un [:contact/name ::profile-image :contact/address])) +(spec/def :message/contact-update (spec/keys :req-un [:contact/name ::profile-image :contact/address])) +(spec/def :message/contact-request-confirmed (spec/keys :req-un [:contact/name ::profile-image :contact/address])) (spec/def :message/new-contact-key (spec/keys :req-un [::sym-key ::topic ::message])) (spec/def :message/message-seen (spec/keys :req-un [:message/ids])) diff --git a/src/status_im/transport/message/contact.cljs b/src/status_im/transport/message/contact.cljs index 54430b2ec735..71170fcc065d 100644 --- a/src/status_im/transport/message/contact.cljs +++ b/src/status_im/transport/message/contact.cljs @@ -3,19 +3,19 @@ (:require [cljs.spec.alpha :as spec] [status-im.transport.message.protocol :as protocol])) -(defrecord ContactRequest [name profile-image address fcm-token device-info] +(defrecord ContactRequest [name profile-image address _ _] protocol/StatusMessage (validate [this] (when (spec/valid? :message/contact-request this) this))) -(defrecord ContactRequestConfirmed [name profile-image address fcm-token device-info] +(defrecord ContactRequestConfirmed [name profile-image address _ _] protocol/StatusMessage (validate [this] (when (spec/valid? :message/contact-request-confirmed this) this))) -(defrecord ContactUpdate [name profile-image address fcm-token device-info] +(defrecord ContactUpdate [name profile-image address _ _] protocol/StatusMessage (validate [this] (when (spec/valid? :message/contact-update this) diff --git a/src/status_im/transport/message/core.cljs b/src/status_im/transport/message/core.cljs index 8de4e97bd9a9..95ec6fd2e919 100644 --- a/src/status_im/transport/message/core.cljs +++ b/src/status_im/transport/message/core.cljs @@ -3,7 +3,6 @@ (:require [goog.object :as o] [re-frame.core :as re-frame] [status-im.chat.models.message :as models.message] - [status-im.contact.device-info :as device-info] [status-im.ethereum.json-rpc :as json-rpc] [status-im.ethereum.core :as ethereum] [status-im.transport.message.contact :as contact] @@ -132,19 +131,7 @@ (remove-hash cofx envelope-hash)) (when-let [{:keys [from]} (get-in db [:chats chat-id :messages message-id])] - (let [{:keys [fcm-token]} (get-in db [:contacts/contacts chat-id]) - ;; We pick the last max-installations devices - fcm-tokens - (as-> (get-in db [:contacts/contacts chat-id :device-info]) $ - (vals $) - (sort-by :timestamp $) - (reverse $) - (map :fcm-token $) - (into #{} $) - (conj $ fcm-token) - (filter identity $) - (take (inc config/max-installations) $))] - (check-confirmations cofx status chat-id message-id)))))) + (check-confirmations cofx status chat-id message-id))))) (fx/defn update-envelopes-status [{:keys [db] :as cofx} envelope-hashes status] @@ -168,13 +155,10 @@ #(or % {:pending-confirmations messages-count})))}) (defn- own-info [db] - (let [{:keys [name photo-path address]} (:multiaccount db) - fcm-token (get-in db [:notifications :fcm-token])] + (let [{:keys [name photo-path address]} (:multiaccount db)] {:name name :profile-image photo-path - :address address - :device-info (device-info/all {:db db}) - :fcm-token fcm-token})) + :address address})) (fx/defn resend-contact-request [cofx own-info chat-id {:keys [sym-key topic]}] (protocol/send (contact/map->ContactRequest own-info) diff --git a/src/status_im/transport/message/pairing.cljs b/src/status_im/transport/message/pairing.cljs index 0483df0fad58..512505210306 100644 --- a/src/status_im/transport/message/pairing.cljs +++ b/src/status_im/transport/message/pairing.cljs @@ -4,7 +4,7 @@ [taoensso.timbre :as log])) (defrecord PairInstallation - [installation-id device-type name fcm-token] + [installation-id device-type name _] protocol/StatusMessage (validate [this] (if (spec/valid? :message/pair-installation this) diff --git a/src/status_im/transport/message/transit.cljs b/src/status_im/transport/message/transit.cljs index a2b434946af8..e1fc6d65b25b 100644 --- a/src/status_im/transport/message/transit.cljs +++ b/src/status_im/transport/message/transit.cljs @@ -25,20 +25,20 @@ (deftype ContactRequestHandler [] Object (tag [this v] "c2") - (rep [this {:keys [name profile-image address fcm-token device-info]}] - #js [name profile-image address fcm-token device-info])) + (rep [this {:keys [name profile-image address]}] + #js [name profile-image address nil nil])) (deftype ContactRequestConfirmedHandler [] Object (tag [this v] "c3") - (rep [this {:keys [name profile-image address fcm-token device-info]}] - #js [name profile-image address fcm-token device-info])) + (rep [this {:keys [name profile-image address]}] + #js [name profile-image address nil nil])) (deftype ContactUpdateHandler [] Object (tag [this v] "c6") - (rep [this {:keys [name profile-image address fcm-token device-info]}] - #js [name profile-image address fcm-token device-info])) + (rep [this {:keys [name profile-image address]}] + #js [name profile-image address nil nil])) ;; It's necessary to support old clients understanding only older, verbose command content (`release/0.9.25` and older) (defn- new->legacy-command-data [{:keys [command-path params] :as content}] @@ -86,8 +86,8 @@ (deftype PairInstallationHandler [] Object (tag [this v] "p2") - (rep [this {:keys [name installation-id device-type fcm-token]}] - #js [installation-id device-type name fcm-token])) + (rep [this {:keys [name installation-id device-type]}] + #js [installation-id device-type name nil])) (def writer (transit/writer :json {:handlers @@ -132,24 +132,24 @@ ;; Here we only need to call the record with the arguments parsed from the clojure datastructures (def reader (transit/reader :json {:handlers - {"c2" (fn [[name profile-image address fcm-token device-info]] - (contact/ContactRequest. name profile-image address fcm-token device-info)) - "c3" (fn [[name profile-image address fcm-token device-info]] - (contact/ContactRequestConfirmed. name profile-image address fcm-token device-info)) + {"c2" (fn [[name profile-image address _ _]] + (contact/ContactRequest. name profile-image address nil nil)) + "c3" (fn [[name profile-image address _ _]] + (contact/ContactRequestConfirmed. name profile-image address nil nil)) "c4" (fn [[legacy-content content-type message-type clock-value timestamp content]] (let [[new-content new-content-type] (legacy->new-message-data (or content legacy-content) content-type)] (protocol/Message. new-content new-content-type message-type clock-value timestamp))) "c7" (fn [[content content-type message-type clock-value timestamp]] (protocol/Message. content content-type message-type clock-value timestamp)) "c5" (fn []) - "c6" (fn [[name profile-image address fcm-token device-info]] - (contact/ContactUpdate. name profile-image address fcm-token device-info)) + "c6" (fn [[name profile-image address _ _]] + (contact/ContactUpdate. name profile-image address nil nil)) "g5" (fn [[chat-id membership-updates message]] (group-chat/GroupMembershipUpdate. chat-id membership-updates message)) "p1" (fn [[contacts account chat]] (pairing/SyncInstallation. contacts account chat)) - "p2" (fn [[installation-id device-type name fcm-token]] - (pairing/PairInstallation. installation-id device-type name fcm-token))}})) + "p2" (fn [[installation-id device-type name _]] + (pairing/PairInstallation. installation-id device-type name nil))}})) (defn serialize "Serializes a record implementing the StatusMessage protocol using the custom writers" diff --git a/src/status_im/ui/screens/db.cljs b/src/status_im/ui/screens/db.cljs index 9b1500563f93..8661c149a02b 100644 --- a/src/status_im/ui/screens/db.cljs +++ b/src/status_im/ui/screens/db.cljs @@ -38,7 +38,6 @@ :peers-count 0 :node-info {} :peers-summary [] - :notifications {} :my-profile/editing? false :transport/filters {} :transport/message-envelopes {} @@ -53,7 +52,6 @@ :initial-props {} :desktop/desktop {:tab-view-id :home} :dimensions/window (dimensions/window) - :push-notifications/stored {} :registry {} :stickers/packs-owned #{} :stickers/packs-pending #{} @@ -167,9 +165,6 @@ ;; DIMENSIONS (spec/def :dimensions/window map?) -;; PUSH NOTIFICATIONS -(spec/def :push-notifications/stored (spec/nilable map?)) - (spec/def ::hardwallet (spec/nilable map?)) (spec/def :stickers/packs (spec/nilable map?)) @@ -215,7 +210,6 @@ :networks/manage :bootnodes/manage :universal-links/url - :push-notifications/stored :browser/browsers :browser/options :new/open-dapp @@ -318,7 +312,6 @@ :wallet/wallet :prices/prices :prices/prices-loading? - :notifications/notifications ::supported-biometric-auth ::collectible ::collectibles diff --git a/src/status_im/ui/screens/intro/views.cljs b/src/status_im/ui/screens/intro/views.cljs index 29c0c3decbe0..9995589b32e2 100644 --- a/src/status_im/ui/screens/intro/views.cljs +++ b/src/status_im/ui/screens/intro/views.cljs @@ -244,11 +244,6 @@ (i18n/label :t/processing)]] [password-container confirm-failure? view-width])) -(defn enable-notifications [] - [vector-icons/icon :main-icons/bell {:container-style {:align-items :center - :justify-content :center} - :width 66 :height 64}]) - (defn bottom-bar [{:keys [step weak-password? encrypt-with-password? forward-action next-button-disabled? @@ -264,11 +259,11 @@ [react/view {:min-height 46 :max-height 46 :align-self :stretch} [react/activity-indicator {:animating true :size :large}]] - (#{:generate-key :recovery-success :enable-notifications} step) + (#{:generate-key :recovery-success} step) (let [label-kw (case step :generate-key :generate-a-key :recovery-success :re-encrypt-key - :enable-notifications :intro-wizard-title6)] + :intro-wizard-title6)] [react/view {:min-height 46 :max-height 46} [components.common/button {:button-style styles/bottom-button :on-press #(re-frame/dispatch @@ -292,12 +287,6 @@ (and (= step :create-code) weak-password?) (and (= step :enter-phrase) next-button-disabled?)) :forward? true}]]]) - (when (= :enable-notifications step) - [components.common/button {:button-style (assoc styles/bottom-button :margin-top 20) - :label (i18n/label :t/maybe-later) - :accessibility-label :skip-notifications-button - :on-press #(re-frame/dispatch [forward-action {:skip? true}]) - :background? false}]) (when (or (= :generate-key step) (and processing? (= :recovery-success step))) [react/text {:style (assoc styles/wizard-text :margin-top 20)} @@ -541,20 +530,6 @@ :forward-action (:forward-action wizard-state)} wizard-state)]]])) -(defn wizard-enable-notifications [] - [react/view {:style {:flex 1}} - [toolbar/toolbar - {:style {:border-bottom-width 0 - :margin-top 16}} - nil - nil] - [react/view {:style {:flex 1 - :justify-content :space-between}} - [top-bar {:step :enable-notifications}] - [enable-notifications] - [bottom-bar {:step :enable-notifications - :forward-action :intro-wizard/step-forward-pressed}]]]) - (defview wizard-enter-phrase [] (letsubs [wizard-state [:intro-wizard/enter-phrase]] [react/keyboard-avoiding-view {:style {:flex 1}} @@ -588,4 +563,3 @@ [bottom-bar {:step :recovery-success :forward-action :multiaccounts.recover/re-encrypt-pressed :processing? processing?}]]])) - diff --git a/src/status_im/ui/screens/routing/intro_login_stack.cljs b/src/status_im/ui/screens/routing/intro_login_stack.cljs index 818eba0eee89..9cf2b8a75848 100644 --- a/src/status_im/ui/screens/routing/intro_login_stack.cljs +++ b/src/status_im/ui/screens/routing/intro_login_stack.cljs @@ -10,7 +10,6 @@ :create-multiaccount-select-key-storage :create-multiaccount-create-code :create-multiaccount-confirm-code - :create-multiaccount-enable-notifications :recover-multiaccount-enter-phrase :recover-multiaccount-select-storage :recover-multiaccount-enter-password @@ -63,7 +62,6 @@ :create-multiaccount-select-key-storage :create-multiaccount-create-code :create-multiaccount-confirm-code - :create-multiaccount-enable-notifications :recover-multiaccount-enter-phrase :recover-multiaccount-select-storage :recover-multiaccount-enter-password @@ -83,8 +81,8 @@ :hardwallet-setup :hardwallet-success])) :config (if - ;; add view-id here if you'd like that view to be - ;; first view when app is started + ;; add view-id here if you'd like that view to be + ;; first view when app is started (#{:login :progress :multiaccounts :enter-pin-login :keycard-login-pin} view-id) {:initialRouteName view-id} {:initialRouteName :login})}) diff --git a/src/status_im/ui/screens/routing/screens.cljs b/src/status_im/ui/screens/routing/screens.cljs index 4d15eda0664d..69b28c2f7147 100644 --- a/src/status_im/ui/screens/routing/screens.cljs +++ b/src/status_im/ui/screens/routing/screens.cljs @@ -79,7 +79,6 @@ :create-multiaccount-select-key-storage intro/wizard-select-key-storage :create-multiaccount-create-code intro/wizard-create-code :create-multiaccount-confirm-code intro/wizard-confirm-code - :create-multiaccount-enable-notifications intro/wizard-enable-notifications :recover-multiaccount-enter-phrase intro/wizard-enter-phrase :recover-multiaccount-success intro/wizard-recovery-success :recover-multiaccount-select-storage intro/wizard-select-key-storage diff --git a/test/cljs/status_im/test/contacts/db.cljs b/test/cljs/status_im/test/contacts/db.cljs index 3c2ff2709d3b..5d6ac57acdfb 100644 --- a/test/cljs/status_im/test/contacts/db.cljs +++ b/test/cljs/status_im/test/contacts/db.cljs @@ -17,7 +17,6 @@ {:last-updated 0, :address "eca8218b5ebeb2c47ba94c1b6e0a779d78fff7bc", :name "User B", - :fcm-token nil, :photo-path "photo1", :last-online 0, :public-key @@ -47,7 +46,6 @@ :public-key "0x048a2f8b80c60f89a91b4c1316e56f75b087f446e7b8701ceca06a40142d8efe1f5aa36bd0fee9e248060a8d5207b43ae98bef4617c18c71e66f920f324869c09f"} {:last-updated 0 :name "User B" - :fcm-token nil :photo-path "photo1" :address "eca8218b5ebeb2c47ba94c1b6e0a779d78fff7bc" :last-online 0 diff --git a/test/cljs/status_im/test/contacts/device_info.cljs b/test/cljs/status_im/test/contacts/device_info.cljs deleted file mode 100644 index 061290b9b99a..000000000000 --- a/test/cljs/status_im/test/contacts/device_info.cljs +++ /dev/null @@ -1,34 +0,0 @@ -(ns status-im.test.contacts.device-info - (:require [cljs.test :refer-macros [deftest is testing]] - [status-im.contact.device-info :as device-info])) - -(def device-list - {"2" {:installation-id "2" - :fcm-token "token-2" - :enabled? true} - "3" {:installation-id "3" - :fcm-token "token-3" - :enabled? false} - "4" {:installation-id "4" - :enabled? true} - "5" {:installation-id "5" - :fcm-token "token-5" - :enabled? true}}) - -(deftest device-info-all - (testing "no devices" - (is (= [{:id "1" - :fcm-token "token-1"}] - (device-info/all {:db {:multiaccount {:installation-id "1"} - :notifications {:fcm-token "token-1"}}}))) - - (testing "some devices" - (is (= [{:id "1" - :fcm-token "token-1"} - {:id "2" - :fcm-token "token-2"} - {:id "5" - :fcm-token "token-5"}] - (device-info/all {:db {:multiaccount {:installation-id "1"} - :pairing/installations device-list - :notifications {:fcm-token "token-1"}}})))))) diff --git a/test/cljs/status_im/test/data_store/contacts.cljs b/test/cljs/status_im/test/data_store/contacts.cljs index 375dfa15d099..c652b4016294 100644 --- a/test/cljs/status_im/test/data_store/contacts.cljs +++ b/test/cljs/status_im/test/data_store/contacts.cljs @@ -8,12 +8,6 @@ :name "name" :photo-path "photo-path" :tribute-to-talk "tribute-to-talk" - :device-info {"1" {:id "1" - :timestamp 1 - :fcm-token "1"} - "2" {:id "2" - :timestamp 2 - :fcm-token 3}} :last-updated 1 :system-tags #{:a :b}} expected-contact {:id "pk" @@ -21,12 +15,7 @@ :name "name" :photoPath "photo-path" :tributeToTalk "[\"~#'\",\"tribute-to-talk\"]" - :deviceInfo [{:installationId "1" - :timestamp 1 - :fcmToken "1"} - {:installationId "2" - :timestamp 2 - :fcmToken 3}] + :lastUpdated 1 :systemTags #{":a" ":b"}}] (testing "->rpc" @@ -40,29 +29,15 @@ :address "address" :name "name" :photoPath "photo-path" - :tributeToTalk "[\"~#'\",\"tribute-to-talk\"]" - - :deviceInfo [{:installationId "1" - :timestamp 1 - :fcmToken "1"} - {:installationId "2" - :timestamp 2 - :fcmToken 3}] - :lastUpdated 1 + :tributeToTalk "[\"~#'\",\"tribute-to-talk\"]" :lastUpdated 1 :systemTags [":a" ":b"]} expected-contact {:public-key "pk" :address "address" :name "name" :photo-path "photo-path" :tribute-to-talk "tribute-to-talk" - :device-info {"1" {:id "1" - :timestamp 1 - :fcm-token "1"} - "2" {:id "2" - :timestamp 2 - :fcm-token 3}} + :last-updated 1 :system-tags #{:a :b}}] (testing "<-rpc" (is (= expected-contact (c/<-rpc contact)))))) - diff --git a/test/cljs/status_im/test/models/contact.cljs b/test/cljs/status_im/test/models/contact.cljs index e3a997c7a309..2d72d6b56429 100644 --- a/test/cljs/status_im/test/models/contact.cljs +++ b/test/cljs/status_im/test/models/contact.cljs @@ -17,10 +17,7 @@ 1 {:name "name" :profile-image "image" - :address "address" - :device-info [{:id "1" - :fcm-token "token-1"}] - :fcm-token "token"}) + :address "address"}) contact (get-in actual [:db :contacts/contacts public-key])] (testing "it adds a new contact" (is (= {:public-key public-key @@ -28,10 +25,6 @@ :name "name" :last-updated 1000 :system-tags #{:contact/request-received} - :device-info {"1" {:id "1" - :timestamp 1 - :fcm-token "token-1"}} - :fcm-token "token" :address "address"} contact))))) (testing "the contact is already in contacts" @@ -42,42 +35,21 @@ :photo-path "old-image" :name "old-name" :last-updated 0 - :device-info {"1" {:id "1" - :timestamp 0 - :fcm-token "token-1"} - "2" {:id "2" - :timestamp 0 - :fcm-token "token-2"}} :system-tags #{:contact/added} - :fcm-token "old-token" :address "old-address"}}}} public-key 1 {:name "new-name" :profile-image "new-image" - :device-info [{:id "2" - :fcm-token "token-2"} - {:id "3" - :fcm-token "token-3"}] - :address "new-address" - :fcm-token "new-token"}) + :address "new-address"}) contact (get-in actual [:db :contacts/contacts public-key])] (testing "it updates the contact and adds contact/request-received to system tags" (is (= {:public-key public-key :photo-path "new-image" :name "new-name" :last-updated 1000 - :device-info {"1" {:id "1" - :fcm-token "token-1" - :timestamp 0} - "2" {:id "2" - :fcm-token "token-2" - :timestamp 1} - "3" {:id "3" - :fcm-token "token-3" - :timestamp 1}} + :system-tags #{:contact/added :contact/request-received} - :fcm-token "new-token" :address "new-address"} contact))))) (testing "timestamp is equal to last-updated" @@ -88,14 +60,12 @@ :name "old-name" :last-updated 1000 :system-tags #{:contact/added} - :fcm-token "old-token" :address "old-address"}}}} public-key 1 {:name "new-name" :profile-image "new-image" - :address "new-address" - :fcm-token "new-token"}) + :address "new-address"}) contact (get-in actual [:db :contacts/contacts public-key])] (testing "it does nothing" (is (nil? actual))))) @@ -107,14 +77,12 @@ :name "old-name" :last-updated 1000 :system-tags #{:contact/added :contact/request-received} - :fcm-token "old-token" :address "old-address"}}}} public-key 0 {:name "new-name" :profile-image "new-image" - :address "new-address" - :fcm-token "new-token"}) + :address "new-address"}) contact (get-in actual [:db :contacts/contacts public-key])] (testing "it does nothing" (is (nil? actual)))))) @@ -123,8 +91,7 @@ {:db {:contacts/contacts {public-key {:public-key public-key :photo-path "old-image" - :device-info {"1" {:id "1" - :fcm-token "token-1"}} + :name "old-name" :last-updated 0 :system-tags #{:contact/added}}}}} @@ -137,8 +104,7 @@ (is (= {:public-key public-key :photo-path "new-image" :name "new-name" - :device-info {"1" {:id "1" - :fcm-token "token-1"}} + :last-updated 1000 :system-tags #{:contact/added :contact/request-received} :address address} contact))))) diff --git a/test/cljs/status_im/test/notifications/core.cljs b/test/cljs/status_im/test/notifications/core.cljs deleted file mode 100644 index 6184a2c98f64..000000000000 --- a/test/cljs/status_im/test/notifications/core.cljs +++ /dev/null @@ -1,44 +0,0 @@ -(ns status-im.test.notifications.core - (:require [cljs.test :refer-macros [deftest is testing]] - [status-im.notifications.core :as notifications])) - -(deftest test-handle-push-notification-open - (testing "user's signing in having opened PN while signed out" - (is (= {:db {:multiaccount {:public-key "0x04d2e59a7501a7bc5bc8bf973a0ab95d06225e2b0f53d5f6be719d857c579bdc1b809bfbe0e8393343f9a5b63a9a90a1a58329c6d1c286d6929f01aaa5472ca9c2"} - :push-notifications/stored {}} - :dispatch [:navigate-to-chat "0x045db1fdb16c4721ddf32e892c5156d9c7a7445482b84ccd41131eb7970f9d623629d86763c5c2a542ae372815125c27eb73535d583d3285bdbfa16ba37f42e2de" {:navigation-reset? true}]} - (notifications/handle-push-notification-open {:db {:push-notifications/stored {} - :multiaccount {:public-key "0x04d2e59a7501a7bc5bc8bf973a0ab95d06225e2b0f53d5f6be719d857c579bdc1b809bfbe0e8393343f9a5b63a9a90a1a58329c6d1c286d6929f01aaa5472ca9c2"}}} - [:push-notification-opened {:from "0x045db1fdb16c4721ddf32e892c5156d9c7a7445482b84ccd41131eb7970f9d623629d86763c5c2a542ae372815125c27eb73535d583d3285bdbfa16ba37f42e2de" - :to "0x04d2e59a7501a7bc5bc8bf973a0ab95d06225e2b0f53d5f6be719d857c579bdc1b809bfbe0e8393343f9a5b63a9a90a1a58329c6d1c286d6929f01aaa5472ca9c2" - :stored? true}])))) - (testing "user's signed in" - (is (= {:db {:multiaccount {:public-key "0x04d2e59a7501a7bc5bc8bf973a0ab95d06225e2b0f53d5f6be719d857c579bdc1b809bfbe0e8393343f9a5b63a9a90a1a58329c6d1c286d6929f01aaa5472ca9c2"} - :push-notifications/stored {}} - :dispatch [:navigate-to-chat "0x045db1fdb16c4721ddf32e892c5156d9c7a7445482b84ccd41131eb7970f9d623629d86763c5c2a542ae372815125c27eb73535d583d3285bdbfa16ba37f42e2de"]} - (notifications/handle-push-notification-open {:db {:push-notifications/stored {} - :multiaccount {:public-key "0x04d2e59a7501a7bc5bc8bf973a0ab95d06225e2b0f53d5f6be719d857c579bdc1b809bfbe0e8393343f9a5b63a9a90a1a58329c6d1c286d6929f01aaa5472ca9c2"}}} - [:push-notification-opened {:from "0x045db1fdb16c4721ddf32e892c5156d9c7a7445482b84ccd41131eb7970f9d623629d86763c5c2a542ae372815125c27eb73535d583d3285bdbfa16ba37f42e2de" - :to "0x04d2e59a7501a7bc5bc8bf973a0ab95d06225e2b0f53d5f6be719d857c579bdc1b809bfbe0e8393343f9a5b63a9a90a1a58329c6d1c286d6929f01aaa5472ca9c2"}])))) - (testing "user's signed in into another multiaccount" - (is (= {} - (notifications/handle-push-notification-open {:db {:multiaccount {:public-key "0x04bc8bf4a91ab726bd98f2c54b3036caacaeea527867945ab839e9ad4e62696856d7f7fa485f68304de357e38a1553eac5592706a16fcf71fd821bbd6c796f9ab3"}}} - [:push-notification-opened {:from "0x045db1fdb16c4721ddf32e892c5156d9c7a7445482b84ccd41131eb7970f9d623629d86763c5c2a542ae372815125c27eb73535d583d3285bdbfa16ba37f42e2de" - :to "0x04d2e59a7501a7bc5bc8bf973a0ab95d06225e2b0f53d5f6be719d857c579bdc1b809bfbe0e8393343f9a5b63a9a90a1a58329c6d1c286d6929f01aaa5472ca9c2"}])))) - (testing "user's not signed in" - (is (= {:db {:multiaccounts/multiaccounts {"bd36cd64e2621b054a3b7464ff1b3c4c304880e7" {:address "bd36cd64e2621b054a3b7464ff1b3c4c304880e7" - :photo-path "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAMAAAC7IEhfAAADAFBMVEX" - :name "Bob" - :public-key "0x04d2e59a7501a7bc5bc8bf973a0ab95d06225e2b0f53d5f6be719d857c579bdc1b809bfbe0e8393343f9a5b63a9a90a1a58329c6d1c286d6929f01aaa5472ca9c2"}} - :multiaccount {:public-key nil} - :push-notifications/stored {"0x04d2e59a7501a7bc5bc8bf973a0ab95d06225e2b0f53d5f6be719d857c579bdc1b809bfbe0e8393343f9a5b63a9a90a1a58329c6d1c286d6929f01aaa5472ca9c2" - "0x045db1fdb16c4721ddf32e892c5156d9c7a7445482b84ccd41131eb7970f9d623629d86763c5c2a542ae372815125c27eb73535d583d3285bdbfa16ba37f42e2de"}} - :dispatch [:ui/open-login "bd36cd64e2621b054a3b7464ff1b3c4c304880e7" "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAMAAAC7IEhfAAADAFBMVEX" "Bob"]} - (notifications/handle-push-notification-open {:db {:multiaccounts/multiaccounts {"bd36cd64e2621b054a3b7464ff1b3c4c304880e7" {:address "bd36cd64e2621b054a3b7464ff1b3c4c304880e7" - :photo-path "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAMAAAC7IEhfAAADAFBMVEX" - :name "Bob" - :public-key "0x04d2e59a7501a7bc5bc8bf973a0ab95d06225e2b0f53d5f6be719d857c579bdc1b809bfbe0e8393343f9a5b63a9a90a1a58329c6d1c286d6929f01aaa5472ca9c2"}} - :multiaccount {:public-key nil} - :push-notifications/stored {}}} - [:push-notification-opened {:from "0x045db1fdb16c4721ddf32e892c5156d9c7a7445482b84ccd41131eb7970f9d623629d86763c5c2a542ae372815125c27eb73535d583d3285bdbfa16ba37f42e2de" - :to "0x04d2e59a7501a7bc5bc8bf973a0ab95d06225e2b0f53d5f6be719d857c579bdc1b809bfbe0e8393343f9a5b63a9a90a1a58329c6d1c286d6929f01aaa5472ca9c2"}]))))) diff --git a/test/cljs/status_im/test/pairing/core.cljs b/test/cljs/status_im/test/pairing/core.cljs index 091519d10b9c..60fca8a7666e 100644 --- a/test/cljs/status_im/test/pairing/core.cljs +++ b/test/cljs/status_im/test/pairing/core.cljs @@ -21,7 +21,7 @@ expected {:system-tags #{:contact/added} :this-should-be-kept true :last-updated 2 - :device-info nil + :name "name-v2" :photo-path "photo-v2"}] (is (= expected (pairing/merge-contact contact-1 contact-2))))) @@ -35,7 +35,7 @@ :photo-path "photo-v2"} expected {:system-tags #{:contact/added} :last-updated 2 - :device-info nil + :name "name-v2" :photo-path "photo-v2"}] (is (= expected (pairing/merge-contact contact-1 contact-2))))) @@ -47,7 +47,7 @@ :photo-path "photo-v2"} expected {:system-tags #{:contact/added} :last-updated 2 - :device-info nil + :name "name-v2" :photo-path "photo-v2"}] (is (= expected (pairing/merge-contact contact-1 contact-2))))) @@ -62,7 +62,7 @@ :photo-path "photo-v2"} expected {:system-tags #{} :last-updated 2 - :device-info nil + :name "name-v2" :photo-path "photo-v2"}] (is (= expected (pairing/merge-contact contact-1 contact-2))))) @@ -77,7 +77,7 @@ :photo-path "photo-v2"} expected {:system-tags #{:contact/added} :last-updated 2 - :device-info nil + :name "name-v2" :photo-path "photo-v2"}] (is (= expected (pairing/merge-contact contact-1 contact-2))))) @@ -89,42 +89,7 @@ :photo-path "photo-v2"} expected {:system-tags #{} :last-updated 2 - :device-info nil - :name "name-v2" - :photo-path "photo-v2"}] - (is (= expected (pairing/merge-contact contact-1 contact-2))))) - (testing "device-info" - (let [contact-1 {:system-tags #{:contact/added} - :last-updated 1 - :name "name-v1" - :device-info {"1" {:timestamp 1 - :fcm-token "token-1" - :id "1"} - "2" {:timestamp 1 - :fcm-token "token-2" - :id "2"}} - :photo-path "photo-v1"} - contact-2 {:system-tags #{:contact/added} - :last-updated 2 - :name "name-v2" - :device-info {"2" {:timestamp 2 - :fcm-token "token-2" - :id "2"} - "3" {:timestamp 2 - :fcm-token "token-3" - :id "3"}} - :photo-path "photo-v2"} - expected {:system-tags #{:contact/added} - :last-updated 2 - :device-info {"1" {:timestamp 1 - :fcm-token "token-1" - :id "1"} - "2" {:timestamp 2 - :fcm-token "token-2" - :id "2"} - "3" {:timestamp 2 - :fcm-token "token-3" - :id "3"}} + :name "name-v2" :photo-path "photo-v2"}] (is (= expected (pairing/merge-contact contact-1 contact-2)))))) @@ -179,12 +144,12 @@ "contact-2" old-contact-2 "contact-4" contact-4 "contact-5" remote-contact-5}} - expected {"contact-1" (assoc new-contact-1 :device-info nil) - "contact-2" (assoc new-contact-2 :device-info nil) + expected {"contact-1" new-contact-1 + "contact-2" new-contact-2 "contact-3" contact-3 "contact-4" (assoc contact-4 :photo-path "generated") - "contact-5" (assoc local-contact-5 :device-info nil)}] + "contact-5" local-contact-5}] (testing "not coming from us" (is (not (:db (pairing/handle-sync-installation cofx sync-message "not-us"))))) (testing "coming from us" @@ -226,7 +191,6 @@ "2" {:has-bundle? false :installation-id "2"}}}} pair-message {:device-type "ios" - :fcm-token "fcm-token" :name "name" :installation-id "1"}] (testing "not coming from us" @@ -234,7 +198,6 @@ (testing "coming from us" (is (= [["1" {:name "name" - :fcmToken "fcm-token" :deviceType "ios"}]] (:pairing/set-installation-metadata (pairing/handle-pair-installation cofx pair-message 1 "us"))))))) diff --git a/test/cljs/status_im/test/runner.cljs b/test/cljs/status_im/test/runner.cljs index 9af82b0f84f4..d0e92e911afe 100644 --- a/test/cljs/status_im/test/runner.cljs +++ b/test/cljs/status_im/test/runner.cljs @@ -13,7 +13,6 @@ [status-im.test.chat.models] [status-im.test.chat.views.photos] [status-im.test.transport.filters.core] - [status-im.test.contacts.device-info] [status-im.test.data-store.chats] [status-im.test.data-store.messages] [status-im.test.data-store.contacts] @@ -77,72 +76,71 @@ (set! goog.DEBUG false) -#_(doo-tests - 'status-im.test.browser.core - 'status-im.test.browser.permissions - 'status-im.test.chat.commands.core - 'status-im.test.chat.commands.impl.transactions - 'status-im.test.chat.commands.input - 'status-im.test.chat.db - 'status-im.test.chat.models - 'status-im.test.chat.models.input - 'status-im.test.chat.models.loading - 'status-im.test.chat.models.message - 'status-im.test.chat.models.message-content - 'status-im.test.chat.views.photos - 'status-im.test.transport.filters.core - 'status-im.test.contacts.db - 'status-im.test.contacts.device-info - 'status-im.test.data-store.chats - 'status-im.test.data-store.messages - 'status-im.test.data-store.contacts - 'status-im.test.ethereum.abi-spec - 'status-im.test.ethereum.core - 'status-im.test.ethereum.eip55 - 'status-im.test.ethereum.eip681 - 'status-im.test.ethereum.ens - 'status-im.test.ethereum.mnemonic - 'status-im.test.ethereum.stateofus - 'status-im.test.fleet.core - 'status-im.test.group-chats.core - 'status-im.test.hardwallet.core - 'status-im.test.i18n - 'status-im.test.mailserver.core - 'status-im.test.mailserver.topics - 'status-im.test.models.bootnode - 'status-im.test.models.contact - 'status-im.test.multiaccounts.model - 'status-im.test.multiaccounts.recover.core - 'status-im.test.multiaccounts.update.core - 'status-im.test.network.core - 'status-im.test.pairing.core - 'status-im.test.search.core - 'status-im.test.sign-in.flow - 'status-im.test.stickers.core - 'status-im.test.signing.core - 'status-im.test.signing.gas - 'status-im.test.transport.core - 'status-im.test.transport.utils - 'status-im.test.tribute-to-talk.core - 'status-im.test.tribute-to-talk.db - 'status-im.test.tribute-to-talk.whitelist - 'status-im.test.ui.screens.add-new.models - 'status-im.test.ui.screens.currency-settings.models - 'status-im.test.ui.screens.wallet.db - 'status-im.test.utils.async - 'status-im.test.utils.clocks - 'status-im.test.utils.contenthash - 'status-im.test.utils.datetime - 'status-im.test.utils.fx - 'status-im.test.utils.http - 'status-im.test.utils.money - 'status-im.test.utils.prices - 'status-im.test.utils.random - 'status-im.test.utils.security - 'status-im.test.utils.signing-phrase.core - 'status-im.test.utils.transducers - 'status-im.test.utils.universal-links.core - 'status-im.test.utils.utils - 'status-im.test.wallet.subs - 'status-im.test.wallet.transactions - 'status-im.test.wallet.transactions.subs) +(doo-tests + 'status-im.test.browser.core + 'status-im.test.browser.permissions + 'status-im.test.chat.commands.core + 'status-im.test.chat.commands.impl.transactions + 'status-im.test.chat.commands.input + 'status-im.test.chat.db + 'status-im.test.chat.models + 'status-im.test.chat.models.input + 'status-im.test.chat.models.loading + 'status-im.test.chat.models.message + 'status-im.test.chat.models.message-content + 'status-im.test.chat.views.photos + 'status-im.test.transport.filters.core + 'status-im.test.contacts.db + 'status-im.test.data-store.chats + 'status-im.test.data-store.messages + 'status-im.test.data-store.contacts + 'status-im.test.ethereum.abi-spec + 'status-im.test.ethereum.core + 'status-im.test.ethereum.eip55 + 'status-im.test.ethereum.eip681 + 'status-im.test.ethereum.ens + 'status-im.test.ethereum.mnemonic + 'status-im.test.ethereum.stateofus + 'status-im.test.fleet.core + 'status-im.test.group-chats.core + 'status-im.test.hardwallet.core + 'status-im.test.i18n + 'status-im.test.mailserver.core + 'status-im.test.mailserver.topics + 'status-im.test.models.bootnode + 'status-im.test.models.contact + 'status-im.test.multiaccounts.model + 'status-im.test.multiaccounts.recover.core + 'status-im.test.multiaccounts.update.core + 'status-im.test.network.core + 'status-im.test.pairing.core + 'status-im.test.search.core + 'status-im.test.sign-in.flow + 'status-im.test.stickers.core + 'status-im.test.signing.core + 'status-im.test.signing.gas + 'status-im.test.transport.core + 'status-im.test.transport.utils + 'status-im.test.tribute-to-talk.core + 'status-im.test.tribute-to-talk.db + 'status-im.test.tribute-to-talk.whitelist + 'status-im.test.ui.screens.add-new.models + 'status-im.test.ui.screens.currency-settings.models + 'status-im.test.ui.screens.wallet.db + 'status-im.test.utils.async + 'status-im.test.utils.clocks + 'status-im.test.utils.contenthash + 'status-im.test.utils.datetime + 'status-im.test.utils.fx + 'status-im.test.utils.http + 'status-im.test.utils.money + 'status-im.test.utils.prices + 'status-im.test.utils.random + 'status-im.test.utils.security + 'status-im.test.utils.signing-phrase.core + 'status-im.test.utils.transducers + 'status-im.test.utils.universal-links.core + 'status-im.test.utils.utils + 'status-im.test.wallet.subs + 'status-im.test.wallet.transactions + 'status-im.test.wallet.transactions.subs) diff --git a/test/cljs/status_im/test/sign_in/data.cljs b/test/cljs/status_im/test/sign_in/data.cljs index c9634765c131..0fc5ce96221d 100644 --- a/test/cljs/status_im/test/sign_in/data.cljs +++ b/test/cljs/status_im/test/sign_in/data.cljs @@ -5,7 +5,6 @@ :tags #{} :address "2f88d65f3cb52605a54a833ae118fb1363acccd2" :name "Darkviolet Lightgreen Halcyon" - :fcm-token "cwigXoAk9R4:APA91bFZOy8vsCj9I9t6PYZXropyYEqAhKaVD2GxrURwvxe_Ay3zLrtJxeirp69se_5EOjS5i4T9xQnoPWrFTLfU9U7AUBdjxZtq5cnlP005bOY05p-psxGsQThMKQMeP5DJC9uxN0Ei" :photo-path "data:image/png;base64iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAMAAAC7IEhfAAADAFBMVEX///+M2KwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY5UBARL8TK8AAAAASUVORK5CYII=" :system-tags #{:contact/added} :last-online 0 @@ -13,7 +12,6 @@ {:last-updated 1547271764000 :address "b267ff8336ac10b3a1986c04a70ff91fb03d0b78" :name "rv" - :fcm-token "dpVPtMBLuv8:APA91bEU4YuSz9yrc-vsiSl-IjdLSR5UpHm7yffaFlWQs_fvsTiK18ZcdYUbzA8iUoNuMVRNF_ngU7JdQInwNpXdGtNv_qcAFt0jhXHqf7dWY-kGJUBw9Ma8G_2fa40JLJchGVrzUIen" :photo-path "data:image/png;base64iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAMAAAC7IEhfAAADAFBMVEX////VjNgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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cljs index a052810889fe..2af77424191e 100644 --- a/test/cljs/status_im/test/utils/universal_links/core.cljs +++ b/test/cljs/status_im/test/utils/universal_links/core.cljs @@ -84,13 +84,3 @@ (testing "http://get.status.im/blah" (testing "it returns false" (is (not (links/deep-link? "http://get.status.im/blah")))))) - -(deftest process-stored-event - (testing "the url is in the database" - (testing "it returns the event" - (= "some-url" - (links/process-stored-event {:db {:universal-links/url "some-url"}})))) - (testing "the url is not in the database" - (testing "it returns nil" - (= nil - (links/process-stored-event {:db {}})))))