Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into rs-pay-2296
Browse files Browse the repository at this point in the history
* origin/main:
  [C-3518] Fix user-list issues, sign-up navigation issue (#6974)
  Quick fix to use release_date for feed ordering (#6972)
  [PAY-2293][PAY-2292] Add coinflow updates (#6967)
  Revert "[PAY-2276] Selectable amounts for coinflow add funds web (#69… (#6970)
  [C-3511] Add Track to Album (mobile + mobile web) (#6962)
  • Loading branch information
schottra committed Dec 18, 2023
2 parents 1f24049 + cfb3c91 commit 546d846
Show file tree
Hide file tree
Showing 50 changed files with 1,102 additions and 940 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import { useRemoteVar } from '../useRemoteVar'
import { PayExtraAmountPresetValues, PayExtraPreset } from './types'

/** Extracts and parses the Pay Extra presets from remote config */
export const usePayExtraPresets = (key: StringKeys) => {
const configValue = useRemoteVar(key)
export const usePayExtraPresets = () => {
const configValue = useRemoteVar(StringKeys.PAY_EXTRA_PRESET_CENT_AMOUNTS)
return useMemo<PayExtraAmountPresetValues>(() => {
const [low, medium, high] = parseIntList(configValue)
return {
Expand Down
4 changes: 2 additions & 2 deletions packages/common/src/services/remote-config/defaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ export const remoteConfigIntDefaults: { [key in IntKeys]: number | null } = {
[IntKeys.DISCOVERY_NOTIFICATIONS_GENESIS_UNIX_TIMESTAMP]: 0,
[IntKeys.CACHE_ENTRY_TTL]: DEFAULT_ENTRY_TTL,
[IntKeys.HANDLE_VERIFICATION_TIMEOUT_MILLIS]:
DEFAULT_HANDLE_VERIFICATION_TIMEOUT_MILLIS
DEFAULT_HANDLE_VERIFICATION_TIMEOUT_MILLIS,
[IntKeys.COINFLOW_MAXIMUM_CENTS]: 1000
}

export const remoteConfigStringDefaults: {
Expand Down Expand Up @@ -90,7 +91,6 @@ export const remoteConfigStringDefaults: {
[StringKeys.STRIPE_ALLOWED_COUNTRIES_2_LETTER]: '',
[StringKeys.AUDIO_FEATURES_DEGRADED_TEXT]: null,
[StringKeys.PAY_EXTRA_PRESET_CENT_AMOUNTS]: '200,500,1000',
[StringKeys.COINFLOW_ADD_FUNDS_PRESET_CENT_AMOUNTS]: '200,500,1000',
[StringKeys.EXPLORE_PREMIUM_DENIED_USERS]: ''
}

Expand Down
10 changes: 5 additions & 5 deletions packages/common/src/services/remote-config/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,10 @@ export enum IntKeys {
/**
* Timeout for handle verification from socials.
*/
HANDLE_VERIFICATION_TIMEOUT_MILLIS = 'HANDLE_VERIFICATION_TIMEOUT_MILLIS'
HANDLE_VERIFICATION_TIMEOUT_MILLIS = 'HANDLE_VERIFICATION_TIMEOUT_MILLIS',

/** Coinflow maximum */
COINFLOW_MAXIMUM_CENTS = 'COINFLOW_MAXIMUM_CENTS'
}

export enum BooleanKeys {
Expand Down Expand Up @@ -390,10 +393,7 @@ export enum StringKeys {
PAY_EXTRA_PRESET_CENT_AMOUNTS = 'PAY_EXTRA_PRESET_CENT_AMOUNTS',

/** Denylist of user ids for explore premium tracks page */
EXPLORE_PREMIUM_DENIED_USERS = 'EXPLORE_PREMIUM_DENIED_USERS',

/** Add funds preset amounts for Coinflow */
COINFLOW_ADD_FUNDS_PRESET_CENT_AMOUNTS = 'COINFLOW_ADD_FUNDS_PRESET_CENT_AMOUNTS'
EXPLORE_PREMIUM_DENIED_USERS = 'EXPLORE_PREMIUM_DENIED_USERS'
}

export type AllRemoteConfigKeys =
Expand Down
5 changes: 3 additions & 2 deletions packages/common/src/store/cache/collections/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,10 @@ export function createPlaylist(

export function createPlaylistRequested(
playlistId: ID,
noticeType: 'route' | 'toast'
noticeType: 'route' | 'toast',
isAlbum: boolean
) {
return { type: CREATE_PLAYLIST_REQUESTED, playlistId, noticeType }
return { type: CREATE_PLAYLIST_REQUESTED, playlistId, noticeType, isAlbum }
}

export function createPlaylistSucceeded() {
Expand Down
6 changes: 3 additions & 3 deletions packages/es-indexer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
"author": "",
"devDependencies": {
"@types/lodash": "4.14.182",
"@types/node": "17.0.29",
"@types/node": "20.10.2",
"@types/pg": "8.6.5",
"ts-node": "10.7.0",
"tsconfig-paths": "3.14.1",
"typescript": "4.6.3"
"typescript": "5.3.2"
},
"dependencies": {
"@elastic/elasticsearch": "8.1.0",
Expand All @@ -31,4 +31,4 @@
"pino": "7.11.0",
"pm2": "5.2.0"
}
}
}
2 changes: 1 addition & 1 deletion packages/es-indexer/src/indexNames.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ export const indexNames = {
playlists: 'playlists18',
reposts: 'reposts13',
saves: 'saves13',
tracks: 'tracks16',
tracks: 'tracks17',
users: 'users16',
}
10 changes: 10 additions & 0 deletions packages/es-indexer/src/indexers/TrackIndexer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,16 @@ export class TrackIndexer extends BaseIndexer<TrackDoc> {
row.repost_count = row.reposted_by.length
row.favorite_count = row.saved_by.length

// get_feed_es uses `created_at` for tracks + playlists + reposts to sequence events
// and has additional logic to compute the "earliest" created_at for an item
// that can be either a track or a repost.
//
// while it would be possible to go adjust all this logic to conditionally use release_date for tracks
// it's much easier to set the `created_at` to be `release_date` for tracks.
//
// my hope is to revisit the action_log concept which will simplify this complex feed logic.
row.created_at = row.release_date || row.created_at

// permalink
const currentRoute = row.routes[row.routes.length - 1]
row.permalink = `/${row.user.handle}/${currentRoute}`
Expand Down
Loading

0 comments on commit 546d846

Please sign in to comment.