Skip to content
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

PROTO-1711: acdc tip notification reactions #8026

Merged
merged 23 commits into from
Apr 11, 2024

Conversation

alecsavvy
Copy link
Contributor

@alecsavvy alecsavvy commented Apr 4, 2024

Description

  • introduces tip notifications with acdc as opposed to identity
  • adds a feature flag to shut on and off
  • adds a test with both identity and acdc storing tip reactions

How Has This Been Tested?

integration tests, client side will have to test on stage because local stack tipping does not work at the moment

Copy link

changeset-bot bot commented Apr 5, 2024

⚠️ No Changeset found

Latest commit: a655912

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@pull-request-size pull-request-size bot added size/XL and removed size/L labels Apr 9, 2024
@alecsavvy alecsavvy marked this pull request as ready for review April 9, 2024 03:04
@alecsavvy alecsavvy self-assigned this Apr 9, 2024
@audius-infra
Copy link
Collaborator

Preview this change https://demo.audius.co/as/proto-1711-acdc-tip-notifs

@audius-infra
Copy link
Collaborator

Preview this change https://demo.audius.co/as/proto-1711-acdc-tip-notifs

Copy link
Contributor

@rickyrombo rickyrombo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work!

* Submits a reaction to a tip being received.
* @hidden
*/
async submitReaction(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: sendTipReaction?

Also (no need to change here) in retrospect I think both this and sendTip should probably be in TipsApi 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought about doing that but I went this route since the tip precedent was already set. Also the TipsApi is only reads and I wasn't sure how much more work adding writes would be. Would be a good follow up to this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I think I remember why I did this - I think sending a tip needs to get the user bank so its easier to have in the user api

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah makes sense

userId: HashId,
metadata: z.object({
reactedTo: z.string().nonempty(),
reactionValue: z.number().int().min(1).max(4)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: the caller shouldn't have to know about the enum values - let's map them for the end caller similar to how we do in the client:

export const reactionOrder: ReactionTypes[] = ['😍', '🔥', '🥳', '🤯']
export const reactionsMap: { [k in ReactionTypes]: number } = {
'😍': 1,
'🔥': 2,
'🥳': 3,
'🤯': 4
}

export const getReactionFromRawValue = (value: number) => {
const val = (Object.entries(reactionsMap) as [ReactionTypes, number][]).find(
([_k, v]) => v === value
)
return val?.[0] ?? null
}

reactionValue: newReactionValue ? reactionsMap[newReactionValue] : 0,

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool i'll add this! thanks

@audius-infra
Copy link
Collaborator

Preview this change https://demo.audius.co/as/proto-1711-acdc-tip-notifs

@audius-infra
Copy link
Collaborator

Preview this change https://demo.audius.co/as/proto-1711-acdc-tip-notifs

@alecsavvy alecsavvy enabled auto-merge (squash) April 11, 2024 16:01
@audius-infra
Copy link
Collaborator

Preview this change https://demo.audius.co/as/proto-1711-acdc-tip-notifs

@alecsavvy alecsavvy merged commit e7c5053 into main Apr 11, 2024
42 of 43 checks passed
@alecsavvy alecsavvy deleted the as/proto-1711-acdc-tip-notifs branch April 11, 2024 16:47
schottra added a commit that referenced this pull request Apr 12, 2024
* origin/main: (24 commits)
  Fix missing isTrack dependency (lint change) (#8096)
  ddex: limit publisher to 3 retries (#8062)
  Bump version to 0.6.80
  remove unused import (#8098)
  [C-4268] Fix player sagas prev functionality for premium track previews (#8094)
  Disable play e2e test (#8095)
  [PAY-2652] Album purchase/sale notifications (#8085)
  [DVRL-25] - Using Wallet Connect on the Protocol Dashboard (#8089)
  [C-4252] Update search screen navigation to clear search on mobile (#8092)
  Unrevert fetch-nft (#8080)
  PROTO-1711: acdc tip notification reactions (#8026)
  Bump version to 0.6.79
  [C-4226] Remove lossless toggle in upload flow and download section on track (#8083)
  [PAY-2677] Retries for Discovery Solana Relay (#8087)
  [PAY-2684] Fix wrap on audio wallet actions (#8073)
  [PAY-2685] Render TrackAddedToPurchasedAlbumNotification on mobile (#8084)
  [PAY-2585] Premium album edit feature (#8071)
  Standardize ddex envs to work with audius-docker-compose better (#8078)
  [PROTO-1754] Fix DDEX albums being editable, fields not persisting (#8077)
  [C-4260] Improve icon a11y (#8075)
  ...
audius-infra pushed a commit that referenced this pull request Apr 13, 2024
[52b1a94] [PAY-2689] Send tips via SDK (behind feature flag) (#8090) Marcus Pasell
[7876f25] require handle_lc in users query (#8102) alecsavvy
[0109139] [PAY-2687] E2E tests for premium album edits (#8082) JD Francis
[6f87d60] Fix missing isTrack dependency (lint change) (#8096) Reed
[f880ab6] ddex: limit publisher to 3 retries (#8062) Steve Perkins
[c50de43] Bump version to 0.6.80 audius-infra
[c632892] remove unused import (#8098) alecsavvy
[93c3292] [C-4268] Fix player sagas prev functionality for premium track previews (#8094) Kyle Shanks
[345d3df] Disable play e2e test (#8095) Sebastian Klingler
[4e85691] [PAY-2652] Album purchase/sale notifications (#8085) Reed
[ef4f367] [DVRL-25] - Using Wallet Connect on the Protocol Dashboard (#8089) Sam Gutentag
[49b7e5d] [C-4252] Update search screen navigation to clear search on mobile (#8092) Kyle Shanks
[caa5e1c] Unrevert fetch-nft (#8080) Sebastian Klingler
[e7c5053] PROTO-1711: acdc tip notification reactions (#8026) alecsavvy
[8be7e4a] Bump version to 0.6.79 audius-infra
[80751a8] [C-4226] Remove lossless toggle in upload flow and download section on track (#8083) Kyle Shanks
[b92bfa5] [PAY-2677] Retries for Discovery Solana Relay (#8087) Marcus Pasell
[61b37bc] [PAY-2684] Fix wrap on audio wallet actions (#8073) Raymond Jacobson
[a08118c] [PAY-2685] Render TrackAddedToPurchasedAlbumNotification on mobile (#8084) Andrew Mendelsohn
[626946d] [PAY-2585] Premium album edit feature (#8071) JD Francis
[d3768ff] Standardize ddex envs to work with audius-docker-compose better (#8078) Theo Ilie
[d2a8359] [PROTO-1754] Fix DDEX albums being editable, fields not persisting (#8077) Theo Ilie
[36f4460] [C-4260] Improve icon a11y (#8075) Dylan Jeffers
[6f1c583] Remove ComputeBudget from Withdrawals (#8081) Marcus Pasell
[24419fc] Reduce border on playlist tile track list (#8079) Andrew Mendelsohn
[e468bf9] [PAY-2668] Purchase/sale details modals album support (#8048) Reed
[b16bad3] First pass of claim all modal (#8072) Isaac Solo
[6d957ad] Use coinflow relay (#8076) Raymond Jacobson
[dd7c896] [PAY-2683] Render TrackAddedToPurchasedAlbum notification (web) (#8074) Andrew Mendelsohn
[c0f7df8] Bump version to 0.6.78 audius-infra
[1de3a7d] Productionize DDEX webserver (#8067) Theo Ilie
[d4b3437] [PAY-2682] Write new TrackAddedToPurchasedAlbum notification to table (#8065) Andrew Mendelsohn
[d02a510] increase solana RPC reselect freq (#8070) Michelle Brier
[339456a] [C-4257] Fix web-dist-win jobs (#8069) Sebastian Klingler
[5b1f635] [C-4258] Fix text input end adornment position (#8068) Kyle Shanks
[25fea8f] [PAY-2630] Album download toggle (#8020) JD Francis
[e964575] chore: Refactor useAccessAndRemixSettings & add unit test (#8049) JD Francis
[643cbba] [C-4256] Fix misaligned artist badge in premium content unlock section (#8066) Kyle Shanks
[d99be37] [C-4001] Add interacive paper variant (#8059) Dylan Jeffers
[6573b6e] [C-4251] Fix mobile collection tile details border (#8064) Kyle Shanks
[26511e4] [PAY-2667] Add nft improvements (#8025) Saliou Diallo
[1024e6e] [C-4253] Fix stats test line-height (#8063) Kyle Shanks
[573c3e1] [Protocol Dashboard] Implement Wallet Connect on Protocol Dashboard [C-3951] (#8010) nicoback2
[08c5def] [PAY-2343] Only dispatch audio matching challenges for valid purchases (#8061) Reed
[878fc5d] Bump version to 0.6.77 audius-infra
[6c9cb8f] [PAY-2579] Change tx handler logs back to warn (#8060) Reed
[75fc24a] [PROTO-1760] Ensure UPC and ISWC are persisted top-level (#8052) Theo Ilie
[c31d52f] Revert fetch-nft changes to unblock CI (#8057) Sebastian Klingler
[8b53199] Skip Mac staging desktop build (#8056) Marcus Pasell
[280850d] [DVRL-23] - DDEX documentation (#8018) Sam Gutentag
[6845e15] Fix failing E2E upload tests (#8055) Marcus Pasell
[f50f032] Notify author on CI success and failure of main branch (#8040) Marcus Pasell
[05d6096] [C-4243] Fix theming on first render (#8046) Dylan Jeffers
[1e0b795] Add `preview:stage` (#8054) Sebastian Klingler
[a508d2a] [PROTO-1752] Delete backfill_cid_data celery task (#8050) Danny
[853aebd] Use vite preview for playwright tests (#8045) Sebastian Klingler
[6e1cf8b] Bump version to 0.6.76 audius-infra
[61721ed] [PROTO-1753] Make ddex publisher+web work with refactored parser (#8038) Theo Ilie
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants