-
Notifications
You must be signed in to change notification settings - Fork 126
Create ChatBlast from web #9447
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This reverts commit 9779b08.
|
|
| GitGuardian id | GitGuardian status | Secret | Commit | Filename | |
|---|---|---|---|---|---|
| 11648676 | Triggered | Generic High Entropy Secret | de2b4a5 | core/infra/dev_config/discovery-one.docker.env | View secret |
| 11648676 | Triggered | Generic High Entropy Secret | b25a9db | core/infra/dev_config/discovery-one.env | View secret |
| 11648676 | Triggered | Generic High Entropy Secret | b25a9db | core/infra/dev_config/discovery-one.docker.env | View secret |
| 11648678 | Triggered | Generic High Entropy Secret | de2b4a5 | core/infra/dev_config/content-three.docker.env | View secret |
| 11648678 | Triggered | Generic High Entropy Secret | b25a9db | core/infra/dev_config/content-three.env | View secret |
| 11648678 | Triggered | Generic High Entropy Secret | b25a9db | core/infra/dev_config/content-three.docker.env | View secret |
| 11648679 | Triggered | Generic High Entropy Secret | de2b4a5 | core/infra/dev_config/content-two.docker.env | View secret |
| 11648679 | Triggered | Generic High Entropy Secret | b25a9db | core/infra/dev_config/content-two.env | View secret |
| 11648679 | Triggered | Generic High Entropy Secret | b25a9db | core/infra/dev_config/content-two.docker.env | View secret |
| 11648680 | Triggered | Generic High Entropy Secret | de2b4a5 | core/infra/dev_config/content-one.docker.env | View secret |
| 11648680 | Triggered | Generic High Entropy Secret | b25a9db | core/infra/dev_config/content-one.docker.env | View secret |
| 11648680 | Triggered | Generic High Entropy Secret | b25a9db | core/infra/dev_config/content-one.env | View secret |
| 13407071 | Triggered | Generic High Entropy Secret | fe8b607 | comms/Makefile | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secrets safely. Learn here the best practices.
- Revoke and rotate these secrets.
- If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
| throw new Error('User not found') | ||
| } | ||
|
|
||
| const chatId = `${audience}${contentType ? `:${contentType}` : ''}${ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should def pull this out to a helper somewhere but doesn't need to be this PR
| !chat || | ||
| !chat?.last_read_at || | ||
| dayjs(chat?.last_read_at).isBefore(chat?.last_message_at) | ||
| (!chat.is_blast && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should early return if it's a blast - otherwise this falls through to the markChatAsReadFailed branch. I think it would also be easier to read.
| chatId ? getChat(state, chatId)?.recheck_permissions : false | ||
| (state: CommonState, { chatId }: { chatId: Maybe<string> }) => { | ||
| const chat = chatId ? getChat(state, chatId) : undefined | ||
| return chat?.is_blast ? true : !!chat?.recheck_permissions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
chat?.is_blast || !!chat?.recheck_perimissions?
| } | ||
|
|
||
| export const ChatBlastCTA = (props: ChatBlastCTAProps) => { | ||
| export const TargetedMessageCTA = (props: TargetedMessageCTAProps) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe leave this as ChatBlastCTA?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah this was an accident, good catch
| // } catch {} | ||
| const existingChat = yield* select((state) => getChat(state, chatId)) | ||
| if (!existingChat) { | ||
| const newBlast: ChatBlast = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: do we need the explicit type still?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, removing it we need a cast later
| yield* call(track, make({ eventName: Name.CREATE_CHAT_SUCCESS })) | ||
| } | ||
| } catch (e) { | ||
| console.error('createChatFailed', e) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's change this to createChatBlastFailed or something
| !chat || | ||
| !chat?.last_read_at || | ||
| dayjs(chat?.last_read_at).isBefore(chat?.last_message_at) | ||
| (!chat.is_blast && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hm this is hard to read...
but also, should it be that this entire if/else is wrapped in an outer if !chat.is_blast? we just don't want to do any mark as read stuff if it's a blast right?
| // This really shouldn't be necessary since the above should be kept in sync | ||
| const chats = getChats(state) | ||
| for (const chat of chats) { | ||
| if (chat.is_blast) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thinking out loud - maybe better pattern is to make a new selector getNonBlastChats or something. but this works for now.
| import { ChatWebsocketError } from './types' | ||
|
|
||
| type UserChatWithMessagesStatus = UserChat & { | ||
| export type Chat = UserChat | ChatBlast |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rickyrombo wdyt about this parent type naming?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Surprised there's no conflict with any types from SDK. I think when I wrote this I was mimicking the UserChallenge. I don't mind it tbh but if it gets confusing we can F2 rename it!
| _action: PayloadAction<{ | ||
| audience: ChatBlastAudience | ||
| contentId?: ID | ||
| contentType?: 'track' | 'album' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: 'track' | 'album' has gotta be a shared type somewhere right? 🤷
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you would think, but we actually do this a lot
| onClick() | ||
| openChatBlastModal() | ||
| }, [onClick, openChatBlastModal]) | ||
| openTargetedMessageModal() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uh-oh, merge main!
|
Preview this change https://demo.audius.co/rt-targeted |
…ts-round-3 * origin/main: (23 commits) Audius Protocol v0.6.169 wrong core defaults (#9452) Don't decrypt plaintext messages (#9448) [QA-1495] Fix 404 for users (#9451) [PAY-3227] Unfurl tracks in composer (#9434) Compose Solana Client in SDK (#9441) Create ChatBlast from web (#9447) [PAY-3341] Add is_plaintext field for chat message (#9442) use const for constants (#9446) core default values (#9445) Rename Targeted Message to Chat Blast (#9443) [C-4964] Comment header changes (#9444) [PAY-3310] Chat blast function in sdk (#9436) Move comments context to common (#9440) [C-4910] Comments replys & deletes fixes (#9437) Audius Protocol v0.6.168 [PAY-3106][PAY-2914] Use SDK to withdraw USDC (#9419) Add social signup feature flag (#9439) use comet repo and modd for hotreloading (#9431) Fix duplicate error name in sentry (#9430) ...
[d712b07] [C-4939] Add comment action menu popup (#9472) JD Francis [641c9c1] [C-4940] Add comment badges (desktop web) (#9475) JD Francis [aca7b5c] [PAY-3315][PAY-3316][PAY-3323] Staking bridge (#9408) Saliou Diallo [bdc139a] [C-4828] Add timestamp features to comments (#9455) JD Francis [3457aeb] [QA-1504] Fix payout wallet set default (#9467) Raymond Jacobson [8c127d0] Add comment replies pagination (#9435) Isaac Solo [c5e250e] [C-4929] Add SendIcon component to harmony and harmony native (#9422) Kyle Shanks [a17b30e] Hook up client blast params to sdk (#9466) Reed [11bf6e3] Don't decrypt plaintext chat.last_message (#9470) Reed [bcaebb0] fix TS error (#9468) JD Francis [bb802b7] Optimistic add chat blasts (#9463) Reed [b5de040] Fix bad claimable challenge state due to nullable max_steps (#9461) Randy Schott [d4c34c3] Fix comment delete in audius-query (#9462) JD Francis [95380d8] [C-4800] Scaffolding for mobile comments (#9449) Sebastian Klingler [fbb4256] [PAY-2917] Migrate user endpoints to SDK, round 3 (#9432) Randy Schott [2c1679a] [PAY-3307] Upgrade chat blasts to chats in sdk (V2) (#9453) Reed [279a9b2] More explicit audience columns for chat blast. (#9454) Steve Perkins [acb857e] Fix bug in profile page 404 (#9456) Raymond Jacobson [c382e82] Don't decrypt plaintext messages (#9448) Reed [172f172] [QA-1495] Fix 404 for users (#9451) Raymond Jacobson [82ab743] [PAY-3227] Unfurl tracks in composer (#9434) Raymond Jacobson [363af71] Compose Solana Client in SDK (#9441) Marcus Pasell [83260f6] Create ChatBlast from web (#9447) Andrew Mendelsohn [19e3bdf] [PAY-3341] Add is_plaintext field for chat message (#9442) Steve Perkins [e25c679] Rename Targeted Message to Chat Blast (#9443) Reed [fc0604c] [C-4964] Comment header changes (#9444) JD Francis [f9e4525] [PAY-3310] Chat blast function in sdk (#9436) Reed [910b655] Move comments context to common (#9440) JD Francis [bb5eaa1] [C-4910] Comments replys & deletes fixes (#9437) JD Francis [1072f5a] [PAY-3106][PAY-2914] Use SDK to withdraw USDC (#9419) Marcus Pasell [1b7bd47] Add social signup feature flag (#9439) Sebastian Klingler [4130f42] Fix duplicate error name in sentry (#9430) Marcus Pasell [54a5a78] [PAY-3300] Chat blast: lazy create thread (#9424) Steve Perkins [ca71d76] [C-4910] Audius-query-ify comments state management (#9423) JD Francis [20a55e9] [PAY-2917][QA-1466] Migrate more users endpoints (#9308) Randy Schott [ab38869] [QA-1434] Fix hanging uploads due to errors on mobile (#9420) Randy Schott [f6ab71c] Add buy button metrics (#9428) Isaac Solo [06ee8a1] Fix pagination args (#9425) Isaac Solo [b91437a] [QA-1501] Fix mobile search input (#9426) Sebastian Klingler [a3c15fd] [C-4932] Add CommentBody component to harmony and harmony-native (#9415) Kyle Shanks
Description
ChatBlasttype to sdkHow Has This Been Tested?
working end to end on local stack
create blast chat, type message, message appears in db