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

Fix release dates and listing status #7037

Merged
merged 1 commit into from
Dec 28, 2023

Conversation

raymondjacobson
Copy link
Member

@raymondjacobson raymondjacobson commented Dec 28, 2023

Description

Fix release dates and listing statuses

Supporting queries

Snapshot 11-6-23:
Get all tracks where release date was null or ahead of created at and private, prior to scheduled releases feature.

select "track_id", "txhash", "title", "release_date", "created_at", "updated_at", "is_unlisted", "field_visibility"
from "tracks"
where ("release_date" > "created_at" or "release_date" = null)
and "is_unlisted" = true

=> 5651

Prod:
Filter out from results above any tracks that are still unlisted

select "track_id" from "tracks"
where "track_id" in (...)
and "txhash" not in (...)
and "is_unlisted" = true

=> 11

Prod
Get all of the transaction hashes from tracks that have been modified by the user since 11-6-23.

select "track_id" from "tracks"
where "track_id" in (...)
and "txhash" not in (...)
and "is_unlisted" = false

=> 98

Prod:
Get all intermediary transaction hashes for these tracks that have changed data (filtering out from this set, anything that was in the original txhash list)

SELECT
	rb.blocknumber,
	track->>'title' AS title,
	track->>'txhash' AS txhash,
	track->>'release_date' AS release_date,
	track->>'created_at' AS created_at,
	track->>'track_id' AS track_id,
	track->>'is_unlisted' AS is_unlisted,
	track->>'blocknumber' AS revert_blocknumber
FROM
	revert_blocks rb
CROSS JOIN LATERAL
	jsonb_array_elements(to_jsonb(rb.prev_records)->'tracks') AS track
WHERE
	(track->>'track_id')::integer in (...)
	and (track->>'txhash') not in (...)

=> 108

Prod:
For all transactions that we found, determine if the user ever submitted a change to publish the track. Filter these out from the original list to get our final list (in this migration).
Note: One of the results from below included a Qm CID that was not a publish action, so it should be kept in the original list of track ids to flip from published->unlisted.

for (let i = 0; i < txs.length; ++i) {
    const tx = await web3.eth.getTransaction(txs[i])
    const decoded = audiusLibs.AudiusABIDecoder.decodeMethod('EntityManager', tx.data)
    const track_id = decoded.params[2].value
    const action = decoded.params[3].value
    try {
        const is_unlisted = JSON.parse(decoded.params[4].value).data.is_unlisted
        if (!is_unlisted) {
            console.log(txs[i], track_id, is_unlisted)
        }
    } catch (e) {
        if (action !== 'Delete') {
            console.log(decoded)   
        }
    }
}

=> 15
This is the list of track ids that a user has published manually since 11-6-23
This contained 1 overlapping track with the 11 found that are still unlisted, so the total count of tracks to repair is

5651 - 11 - 15 + 1 = 5626

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide repro instructions & any configuration.

Copy link

vercel bot commented Dec 28, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Updated (UTC)
audius-web-ssr ⬜️ Ignored (Inspect) Dec 28, 2023 1:57am

@raymondjacobson raymondjacobson merged commit 8e65654 into main Dec 28, 2023
13 checks passed
@raymondjacobson raymondjacobson deleted the rj-fix-ahead-release-dates branch December 28, 2023 02:16
isaacsolo pushed a commit that referenced this pull request Dec 28, 2023
audius-infra pushed a commit that referenced this pull request Dec 30, 2023
[54e51d0] [C-3521] Add option menu to create collection tile (web) (#7046) Andrew Mendelsohn
[8300ad0] [C-3550] Upgrade react native to 0.73.1 (#7042) Dylan Jeffers
[116a19a] [SDK] Fix validate ETH address util (#7043) nicoback2
[e6a4565] [C-3533] Fix add track to collection toast (#7044) Andrew Mendelsohn
[8c1e557] Reland "Add Solana Support to SDK with sdk.users.sendTip() (#6891)" (#7025) Marcus Pasell
[9700752] Add rate limits for DashboardWalletUser relays (#7041) nicoback2
[95dd48f] [C-3434] Add Divider to native harmony (#7040) Kyle Shanks
[858da9f] [SDK] Export DashboardWalletUsersAPI + types in SDK index file, add missing param (#7039) nicoback2
[a2d87ca] [SDK] Have DashboardWalletUsers extend generated dashboard wallet users API (#7033) nicoback2
[eec88be] [PROTO-1492] Add sandbox env to comms (#7030) Theo Ilie
[ad3f877] [C-3547] Upgrade eslint, typescript, and prettier (#7036) Dylan Jeffers
[8e65654] Fix release dates and listing status (#7037) Raymond Jacobson
[0729448] Disable scheduled releases job (#7035) Raymond Jacobson
[ddac7e8] [C-3545] Upgrade reanimated and dependents (#7031) Dylan Jeffers
[dea3dfb] Run comms locally via audius-compose (#7028) Marcus Pasell
[14385bf] Disable slack notify if full release when sent to app store (#7032) Raymond Jacobson
[29cf448] [C-3489, C-3516] Sign up QA #3 (#7016) Dylan Jeffers
[2e7f47e] [C-3526] Select artist screen perf (#7018) Dylan Jeffers
[2dcdb5a] [C-3540] tRPC call to get albums for track (#7029) Andrew Mendelsohn
[44b99b6] Re-gen SDK for DashboardWalletUsers APIs (#7027) nicoback2
schottra added a commit that referenced this pull request Jan 2, 2024
* origin/main: (64 commits)
  v1.5.58
  [C-3521] Add option menu to create collection tile (web) (#7046)
  [C-3550] Upgrade react native to 0.73.1 (#7042)
  [SDK] Fix validate ETH address util (#7043)
  [C-3533] Fix add track to collection toast (#7044)
  Reland "Add Solana Support to SDK with sdk.users.sendTip() (#6891)" (#7025)
  Add rate limits for DashboardWalletUser relays (#7041)
  [C-3434] Add Divider to native harmony (#7040)
  [SDK] Export DashboardWalletUsersAPI + types in SDK index file, add missing param (#7039)
  [SDK] Have DashboardWalletUsers extend generated dashboard wallet users API (#7033)
  [PROTO-1492] Add sandbox env to comms (#7030)
  [C-3547] Upgrade eslint, typescript, and prettier (#7036)
  Fix release dates and listing status (#7037)
  Disable scheduled releases job (#7035)
  [C-3545] Upgrade reanimated and dependents (#7031)
  Run comms locally via audius-compose (#7028)
  Disable slack notify if full release when sent to app store (#7032)
  [C-3489, C-3516] Sign up QA #3 (#7016)
  [C-3526] Select artist screen perf (#7018)
  [C-3540] tRPC call to get albums for track (#7029)
  ...
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.

2 participants