From 783984d4d39d04b82a720732084857234eb0b81c Mon Sep 17 00:00:00 2001 From: Steve Larson <9larsons@gmail.com> Date: Tue, 18 Jun 2024 13:44:43 -0500 Subject: [PATCH] Added Sentry logging for unsaved changes modal in admin (#20408) ref https://linear.app/tryghost/issue/ONC-94 - adds Sentry logging for the unsaved changes modal in Admin (tags, members, collections) This will let us monitor for spikes in rates so we know if a change to Ghost has caused faulty logic in detecting dirty models. --- ghost/admin/app/routes/collection.js | 2 ++ ghost/admin/app/routes/member.js | 2 ++ ghost/admin/app/routes/tag.js | 2 ++ 3 files changed, 6 insertions(+) diff --git a/ghost/admin/app/routes/collection.js b/ghost/admin/app/routes/collection.js index 7110da473f..f19f609f76 100644 --- a/ghost/admin/app/routes/collection.js +++ b/ghost/admin/app/routes/collection.js @@ -1,3 +1,4 @@ +import * as Sentry from '@sentry/ember'; import AuthenticatedRoute from 'ghost-admin/routes/authenticated'; import ConfirmUnsavedChangesModal from '../components/modals/confirm-unsaved-changes'; import {action} from '@ember/object'; @@ -77,6 +78,7 @@ export default class CollectionRoute extends AuthenticatedRoute { async confirmUnsavedChanges() { if (this.controller.model?.hasDirtyAttributes) { + Sentry.captureMessage('showing unsaved changes modal for collections route'); this.confirmModal = this.modals .open(ConfirmUnsavedChangesModal) .finally(() => { diff --git a/ghost/admin/app/routes/member.js b/ghost/admin/app/routes/member.js index b0b245376b..ab9bdc8c75 100644 --- a/ghost/admin/app/routes/member.js +++ b/ghost/admin/app/routes/member.js @@ -1,3 +1,4 @@ +import * as Sentry from '@sentry/ember'; import AdminRoute from 'ghost-admin/routes/admin'; import ConfirmUnsavedChangesModal from '../components/modals/confirm-unsaved-changes'; import {action} from '@ember/object'; @@ -96,6 +97,7 @@ export default class MembersRoute extends AdminRoute { } async confirmUnsavedChanges() { + Sentry.captureMessage('showing unsaved changes modal for members route'); this.confirmModal = this.modals .open(ConfirmUnsavedChangesModal) .finally(() => { diff --git a/ghost/admin/app/routes/tag.js b/ghost/admin/app/routes/tag.js index ada63bba91..17443be1dc 100644 --- a/ghost/admin/app/routes/tag.js +++ b/ghost/admin/app/routes/tag.js @@ -1,3 +1,4 @@ +import * as Sentry from '@sentry/ember'; import AuthenticatedRoute from 'ghost-admin/routes/authenticated'; import ConfirmUnsavedChangesModal from '../components/modals/confirm-unsaved-changes'; import {action} from '@ember/object'; @@ -77,6 +78,7 @@ export default class TagRoute extends AuthenticatedRoute { async confirmUnsavedChanges() { if (this.controller.model?.hasDirtyAttributes) { + Sentry.captureMessage('showing unsaved changes modal for tags route'); this.confirmModal = this.modals .open(ConfirmUnsavedChangesModal) .finally(() => {