Browse Source

feat(replay): add viewed_by_ids to replay search fields (#69364)

Follow up from https://github.com/getsentry/sentry/issues/64924

Before/after:

![Before](https://github.com/getsentry/sentry/assets/159852527/1bea0567-0954-474f-a2cf-2ad5b8e152fb)

<img width="683" alt="Screenshot 2024-04-19 at 3 32 34 PM"
src="https://github.com/getsentry/sentry/assets/159852527/4a2d2ad7-2d0c-4c3b-9dde-31ecf32487dc">

Followed up with docs PR for searchable properties

---------

Co-authored-by: getsantry[bot] <66042841+getsantry[bot]@users.noreply.github.com>
Co-authored-by: Michelle Zhang <56095982+michellewzhang@users.noreply.github.com>
Andrew Liu 10 months ago
parent
commit
a2db40f1ce
1 changed files with 15 additions and 1 deletions
  1. 15 1
      static/app/utils/fields/index.ts

+ 15 - 1
static/app/utils/fields/index.ts

@@ -1237,7 +1237,9 @@ export enum ReplayFieldKey {
   ERROR_IDS = 'error_ids',
   OS_NAME = 'os.name',
   OS_VERSION = 'os.version',
+  SEEN_BY_ID = 'seen_by_id',
   URLS = 'urls',
+  VIEWED_BY_ID = 'viewed_by_id',
 }
 
 export enum ReplayClickFieldKey {
@@ -1288,12 +1290,14 @@ export const REPLAY_FIELDS = [
   FieldKey.RELEASE,
   FieldKey.SDK_NAME,
   FieldKey.SDK_VERSION,
+  ReplayFieldKey.SEEN_BY_ID,
   FieldKey.TRACE,
   ReplayFieldKey.URLS,
   FieldKey.USER_EMAIL,
   FieldKey.USER_ID,
   FieldKey.USER_IP,
   FieldKey.USER_USERNAME,
+  ReplayFieldKey.VIEWED_BY_ID,
 ];
 
 const REPLAY_FIELD_DEFINITIONS: Record<ReplayFieldKey, FieldDefinition> = {
@@ -1357,11 +1361,21 @@ const REPLAY_FIELD_DEFINITIONS: Record<ReplayFieldKey, FieldDefinition> = {
     kind: FieldKind.FIELD,
     valueType: FieldValueType.STRING,
   },
+  [ReplayFieldKey.SEEN_BY_ID]: {
+    desc: t('Sentry user ID(s) who have seen this replay'),
+    kind: FieldKind.FIELD,
+    valueType: FieldValueType.INTEGER,
+  },
   [ReplayFieldKey.URLS]: {
-    desc: t('List of urls that were visited within the Replay'),
+    desc: t('List of urls that were visited within the replay'),
     kind: FieldKind.FIELD,
     valueType: FieldValueType.STRING,
   },
+  [ReplayFieldKey.VIEWED_BY_ID]: {
+    desc: t('Sentry user ID(s) who have seen this replay'),
+    kind: FieldKind.FIELD,
+    valueType: FieldValueType.INTEGER,
+  },
 };
 
 export const REPLAY_CLICK_FIELDS = [