Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const MOCK_APP_CONTEXT: AppContext = {
app_id: '3145EA1A-0EAE-3F8C-969A-13A01394D3EA',
type: 'app',
in_foreground: false,
is_active: false,
app_memory: 1048576 * 12,
view_names: ['app.view1', 'app.view2'],
// Extra data is still valid and preserved
Expand Down Expand Up @@ -65,6 +66,7 @@ describe('AppContext', () => {
value: '3145EA1A-0EAE-3F8C-969A-13A01394D3EA',
},
{key: 'in_foreground', subject: 'In Foreground', value: false},
{key: 'is_active', subject: 'Is Active', value: false},
{key: 'app_memory', subject: 'Memory Usage', value: '12.0 MiB'},
{
key: 'view_names',
Expand Down
8 changes: 8 additions & 0 deletions static/app/components/events/contexts/knownContext/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ enum AppContextKeys {
VERSION = 'app_version',
BUILD = 'app_build',
IN_FOREGROUND = 'in_foreground',
IS_ACTIVE = 'is_active',
APP_MEMORY = 'app_memory',
VIEW_NAMES = 'view_names',
// XXX: From https://github.com/getsentry/sentry/issues/87238, not in the schema yet.
Expand All @@ -37,6 +38,7 @@ export interface AppContext {
[AppContextKeys.TYPE]?: string;
[AppContextKeys.DEVICE_HASH]?: string;
[AppContextKeys.IN_FOREGROUND]?: boolean;
[AppContextKeys.IS_ACTIVE]?: boolean;
[AppContextKeys.APP_MEMORY]?: number;
[AppContextKeys.VIEW_NAMES]?: string[];
[AppContextKeys.FREE_MEMORY]?: number;
Expand Down Expand Up @@ -119,6 +121,12 @@ export function getAppContextData({
subject: t('In Foreground'),
value: data.in_foreground,
};
case AppContextKeys.IS_ACTIVE:
return {
key: ctxKey,
subject: t('Is Active'),
value: data.is_active,
};
case AppContextKeys.APP_MEMORY:
return {
key: ctxKey,
Expand Down
Loading