Skip to content

Commit

Permalink
Add feature flagged option to intentionally panic
Browse files Browse the repository at this point in the history
  • Loading branch information
ilmotta committed Dec 2, 2024
1 parent 25a41f0 commit 3fc9ea1
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 11 deletions.
6 changes: 0 additions & 6 deletions shadow-cljs.edn
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,7 @@
#shadow/env "STATUS_BACKEND_SERVER_IMAGE_SERVER_URI_PREFIX"
status-im.config/STATUS_BACKEND_SERVER_ROOT_DATA_DIR #shadow/env
"STATUS_BACKEND_SERVER_ROOT_DATA_DIR"

status-im.config/SENTRY_DSN_STATUS_GO #shadow/env "SENTRY_DSN_STATUS_GO"
status-im.config/SENTRY_CONTEXT_NAME #shadow/env "SENTRY_CONTEXT_NAME"
status-im.config/SENTRY_CONTEXT_VERSION #shadow/env "SENTRY_CONTEXT_VERSION"
status-im.config/SENTRY_ENVIRONMENT #shadow/env "SENTRY_ENVIRONMENT"
status-im.config/SENTRY_PRODUCTION #shadow/env "SENTRY_PRODUCTION"

status-im.config/MIXPANEL_APP_ID #shadow/env "MIXPANEL_APP_ID"
status-im.config/MIXPANEL_TOKEN #shadow/env "MIXPANEL_TOKEN"
status-im.config/OPENSEA_API_KEY #shadow/env "OPENSEA_API_KEY"
Expand Down
10 changes: 9 additions & 1 deletion src/legacy/status_im/ui/screens/advanced_settings/views.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
[legacy.status-im.ui.components.list.views :as list]
[quo.core :as quo]
[re-frame.core :as re-frame]
[status-im.feature-flags :as ff]
[utils.i18n :as i18n]
[utils.re-frame :as rf])
(:require-macros [legacy.status-im.utils.views :as views]))
Expand All @@ -22,7 +23,14 @@
peer-syncing-enabled?]}]
(keep
identity
[{:size :small
[(when (ff/enabled? ::ff/app-monitoring.intentional-crash)
{:size :small
:title "Force crash immediately"
:accessibility-label :intended-panic
:on-press (fn []
(re-frame/dispatch [:app-monitoring/intended-panic
"status-mobile intentional panic"]))})
{:size :small
:title (i18n/label :t/log-level)
:accessibility-label :log-level-settings-button
:on-press
Expand Down
8 changes: 8 additions & 0 deletions src/status_im/common/app_monitoring/effects.cljs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
(ns status-im.common.app-monitoring.effects
(:require
[native-module.core :as native-module]
[utils.re-frame :as rf]))

(rf/reg-fx :effects.app-monitoring/intended-panic
(fn [message]
(native-module/intended-panic message)))
8 changes: 8 additions & 0 deletions src/status_im/common/app_monitoring/events.cljs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
(ns status-im.common.app-monitoring.events
(:require
status-im.common.app-monitoring.effects
[utils.re-frame :as rf]))

(rf/reg-event-fx :app-monitoring/intended-panic
(fn [_ [message]]
{:fx [[:effects.app-monitoring/intended-panic message]]}))
5 changes: 1 addition & 4 deletions src/status_im/config.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,5 @@
(goog-define STATUS_BACKEND_SERVER_IMAGE_SERVER_URI_PREFIX "https://localhost:")

;;;; Sentry
;; Documentation: status-go/internal/sentry/README.md
(goog-define SENTRY_DSN_STATUS_GO "")
(goog-define SENTRY_CONTEXT_NAME "status-mobile")
(goog-define SENTRY_CONTEXT_VERSION "0.0.1")
(goog-define SENTRY_ENVIRONMENT "")
(goog-define SENTRY_PRODUCTION "0")
1 change: 1 addition & 0 deletions src/status_im/events.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
(:require
status-im.common.alert-banner.events
status-im.common.alert.effects
status-im.common.app-monitoring.events
status-im.common.async-storage.effects
status-im.common.emoji-picker.events
status-im.common.font.events
Expand Down
1 change: 1 addition & 0 deletions src/status_im/feature_flags.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

(def ^:private initial-flags
{::community.edit-account-selection (enabled-in-env? :FLAG_EDIT_ACCOUNT_SELECTION_ENABLED)
::app-monitoring.intentional-crash (enabled-in-env? :FLAG_INTENTIONAL_CRASH_ENABLED)

;; Feature toggled (off by default) because the desktop app disabled this
;; feature and we want both clients in sync. We keep the code because it
Expand Down

0 comments on commit 3fc9ea1

Please sign in to comment.