Skip to content

Commit

Permalink
Adjust gates (#7132)
Browse files Browse the repository at this point in the history
* Remove dead gate

* Adjust gates

* No need to disable exposures
  • Loading branch information
gaearon authored Dec 16, 2024
1 parent c339dc5 commit de97c07
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 29 deletions.
10 changes: 0 additions & 10 deletions src/lib/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,6 @@ export const STARTER_PACK_MAX_SIZE = 150
// -prf
export const JOINED_THIS_WEEK = 2880000 // estimate as of 11/26/24

export const DISCOVER_DEBUG_DIDS: Record<string, true> = {
'did:plc:oisofpd7lj26yvgiivf3lxsi': true, // hailey.at
'did:plc:fpruhuo22xkm5o7ttr2ktxdo': true, // danabra.mov
'did:plc:p2cp5gopk7mgjegy6wadk3ep': true, // samuel.bsky.team
'did:plc:ragtjsm2j2vknwkz3zp4oxrd': true, // pfrazee.com
'did:plc:vpkhqolt662uhesyj6nxm7ys': true, // why.bsky.team
'did:plc:3jpt2mvvsumj2r7eqk4gzzjz': true, // esb.lol
'did:plc:vjug55kidv6sye7ykr5faxxn': true, // emilyliu.me
}

const BASE_FEEDBACK_FORM_URL = `${HELP_DESK_URL}/requests/new`
export function FEEDBACK_FORM_URL({
email,
Expand Down
4 changes: 1 addition & 3 deletions src/lib/statsig/gates.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
export type Gate =
// Keep this alphabetic please.
| 'debug_show_feedcontext' // DISABLED DUE TO EME
| 'post_feed_lang_window' // DISABLED DUE TO EME
| 'remove_show_latest_button'
'debug_show_feedcontext' | 'debug_subscriptions' | 'remove_show_latest_button'
8 changes: 4 additions & 4 deletions src/screens/Settings/AppIconSettings/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import {useLingui} from '@lingui/react'
import * as DynamicAppIcon from '@mozzius/expo-dynamic-app-icon'
import {NativeStackScreenProps} from '@react-navigation/native-stack'

import {DISCOVER_DEBUG_DIDS} from '#/lib/constants'
import {IS_INTERNAL} from '#/lib/app-info'
import {PressableScale} from '#/lib/custom-animations/PressableScale'
import {CommonNavigatorParams} from '#/lib/routes/types'
import {useGate} from '#/lib/statsig/statsig'
import {isAndroid} from '#/platform/detection'
import {useSession} from '#/state/session'
import {AppIconImage} from '#/screens/Settings/AppIconSettings/AppIconImage'
import {AppIconSet} from '#/screens/Settings/AppIconSettings/types'
import {useAppIconSets} from '#/screens/Settings/AppIconSettings/useAppIconSets'
Expand All @@ -23,7 +23,7 @@ export function AppIconSettingsScreen({}: Props) {
const t = useTheme()
const {_} = useLingui()
const sets = useAppIconSets()
const {currentAccount} = useSession()
const gate = useGate()
const [currentAppIcon, setCurrentAppIcon] = useState(() =>
getAppIconName(DynamicAppIcon.getAppIcon()),
)
Expand Down Expand Up @@ -86,7 +86,7 @@ export function AppIconSettingsScreen({}: Props) {
))}
</Group>

{DISCOVER_DEBUG_DIDS[currentAccount?.did ?? ''] && (
{IS_INTERNAL && gate('debug_subscriptions') && (
<>
<Text
style={[
Expand Down
9 changes: 4 additions & 5 deletions src/screens/Settings/AppearanceSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import Animated, {
import {msg, Trans} from '@lingui/macro'
import {useLingui} from '@lingui/react'

import {DISCOVER_DEBUG_DIDS} from '#/lib/constants'
import {IS_INTERNAL} from '#/lib/app-info'
import {CommonNavigatorParams, NativeStackScreenProps} from '#/lib/routes/types'
import {useGate} from '#/lib/statsig/statsig'
import {isNative} from '#/platform/detection'
import {useSession} from '#/state/session'
import {useSetThemePrefs, useThemePrefs} from '#/state/shell'
import {SettingsListItem as AppIconSettingsListItem} from '#/screens/Settings/AppIconSettings/SettingsListItem'
import {atoms as a, native, useAlf, useTheme} from '#/alf'
Expand All @@ -29,6 +29,7 @@ type Props = NativeStackScreenProps<CommonNavigatorParams, 'AppearanceSettings'>
export function AppearanceSettingsScreen({}: Props) {
const {_} = useLingui()
const {fonts} = useAlf()
const gate = useGate()

const {colorMode, darkTheme} = useThemePrefs()
const {setColorMode, setDarkTheme} = useSetThemePrefs()
Expand Down Expand Up @@ -74,8 +75,6 @@ export function AppearanceSettingsScreen({}: Props) {
[fonts],
)

const {currentAccount} = useSession()

return (
<LayoutAnimationConfig skipExiting skipEntering>
<Layout.Screen testID="preferencesThreadsScreen">
Expand Down Expand Up @@ -178,7 +177,7 @@ export function AppearanceSettingsScreen({}: Props) {
onChange={onChangeFontScale}
/>

{isNative && DISCOVER_DEBUG_DIDS[currentAccount?.did ?? ''] && (
{isNative && IS_INTERNAL && gate('debug_subscriptions') && (
<>
<SettingsList.Divider />
<AppIconSettingsListItem />
Expand Down
5 changes: 1 addition & 4 deletions src/state/queries/post-feed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,8 @@ export function usePostFeedQuery(
/**
* The number of posts to fetch in a single request. Because we filter
* unwanted content, we may over-fetch here to try and fill pages by
* `MIN_POSTS`.
* `MIN_POSTS`. But if you're doing this, ask @why if it's ok first.
*/

// TEMPORARILY DISABLING GATE TO PREVENT EVENT CONSUMPTION @TODO EME-GATE
// const fetchLimit = gate('post_feed_lang_window') ? 100 : MIN_POSTS
const fetchLimit = MIN_POSTS

// Make sure this doesn't invalidate unless really needed.
Expand Down
7 changes: 4 additions & 3 deletions src/view/com/util/post-ctrls/PostCtrls.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@ import {msg, plural} from '@lingui/macro'
import {useLingui} from '@lingui/react'

import {IS_INTERNAL} from '#/lib/app-info'
import {DISCOVER_DEBUG_DIDS, POST_CTRL_HITSLOP} from '#/lib/constants'
import {POST_CTRL_HITSLOP} from '#/lib/constants'
import {CountWheel} from '#/lib/custom-animations/CountWheel'
import {AnimatedLikeIcon} from '#/lib/custom-animations/LikeIcon'
import {useHaptics} from '#/lib/haptics'
import {makeProfileLink} from '#/lib/routes/links'
import {shareUrl} from '#/lib/sharing'
import {useGate} from '#/lib/statsig/statsig'
import {toShareUrl} from '#/lib/strings/url-helpers'
import {Shadow} from '#/state/cache/types'
import {useFeedFeedbackContext} from '#/state/feed-feedback'
Expand Down Expand Up @@ -85,8 +86,8 @@ let PostCtrls = ({
const {sendInteraction} = useFeedFeedbackContext()
const {captureAction} = useProgressGuideControls()
const playHaptic = useHaptics()
const isDiscoverDebugUser =
IS_INTERNAL || DISCOVER_DEBUG_DIDS[currentAccount?.did ?? '']
const gate = useGate()
const isDiscoverDebugUser = IS_INTERNAL || gate('debug_show_feedcontext')
const isBlocked = Boolean(
post.author.viewer?.blocking ||
post.author.viewer?.blockedBy ||
Expand Down

0 comments on commit de97c07

Please sign in to comment.