Merge remote-tracking branch 'origin/main' into 3p-moderators

* origin/main:
  add warning to profile as well
  use prompt.basic instead of full prompt
  [Statsig] Track posting, end reached (#3206)
  [Statsig] Track likes, reposts, follows (#3195)
  1.73 Version Bump (#3200)
This commit is contained in:
Eric Bailey
2024-03-14 14:55:17 -05:00
18 changed files with 210 additions and 34 deletions
+43 -1
View File
@@ -1,5 +1,47 @@
export type Events = {
export type LogEvents = {
init: {
initMs: number
}
'feed:endReached': {
feedType: string
itemCount: number
}
'post:create': {
imageCount: number
isReply: boolean
hasLink: boolean
hasQuote: boolean
langs: string
logContext: 'Composer'
}
'post:like': {
logContext: 'FeedItem' | 'PostThreadItem' | 'Post'
}
'post:repost': {
logContext: 'FeedItem' | 'PostThreadItem' | 'Post'
}
'post:unlike': {
logContext: 'FeedItem' | 'PostThreadItem' | 'Post'
}
'post:unrepost': {
logContext: 'FeedItem' | 'PostThreadItem' | 'Post'
}
'profile:follow': {
logContext:
| 'RecommendedFollowsItem'
| 'PostThreadItem'
| 'ProfileCard'
| 'ProfileHeader'
| 'ProfileHeaderSuggestedFollows'
| 'ProfileMenu'
}
'profile:unfollow': {
logContext:
| 'RecommendedFollowsItem'
| 'PostThreadItem'
| 'ProfileCard'
| 'ProfileHeader'
| 'ProfileHeaderSuggestedFollows'
| 'ProfileMenu'
}
}
+5 -3
View File
@@ -6,7 +6,9 @@ import {
} from 'statsig-react-native-expo'
import {useSession} from '../../state/session'
import {sha256} from 'js-sha256'
import {Events} from './events'
import {LogEvents} from './events'
export type {LogEvents}
const statsigOptions = {
environment: {
@@ -31,9 +33,9 @@ export function attachRouteToLogEvents(
getCurrentRouteName = getRouteName
}
export function logEvent<E extends keyof Events>(
export function logEvent<E extends keyof LogEvents>(
eventName: E & string,
rawMetadata?: Events[E] & FlatJSONRecord,
rawMetadata: LogEvents[E] & FlatJSONRecord,
) {
const fullMetadata = {
...rawMetadata,