-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main' into fix-user-override
* origin/main: Audius Protocol v0.6.112 Audius Client (Web and Mobile) v1.5.82 [PAY-2714] track_added_to_purchased_album noti test (#8616) [C-3681] Add native mobile buffer (#8606)
- Loading branch information
Showing
18 changed files
with
263 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"version": "0.6.111", | ||
"version": "0.6.112", | ||
"service": "content-node" | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"version": "0.6.111", | ||
"version": "0.6.112", | ||
"service": "discovery-node" | ||
} |
155 changes: 155 additions & 0 deletions
155
...tion_tests/queries/test_notifications/test_track_added_to_purchased_album_notification.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,155 @@ | ||
import logging | ||
|
||
from integration_tests.utils import populate_mock_db | ||
from src.api.v1.utils.extend_notification import extend_notification | ||
from src.models.users.usdc_purchase import PurchaseType | ||
from src.queries.get_notifications import NotificationType, get_notifications | ||
from src.utils.db_session import get_db | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
def test_get_track_added_to_purchased_album_notifications(app): | ||
with app.app_context(): | ||
db_mock = get_db() | ||
|
||
test_entities = { | ||
"users": [{"user_id": i + 1} for i in range(2)], | ||
"tracks": [{"track_id": 6, "owner_id": 1}], | ||
"playlists": [ | ||
{ | ||
"playlist_id": 5, | ||
"playlist_owner_id": 1, | ||
"playlist_name": "name", | ||
"description": "description", | ||
"is_album": True, | ||
"is_stream_gated": True, | ||
"stream_conditions": { | ||
"usdc_purchase": { | ||
"price": 100, | ||
"splits": { | ||
"7gfRGGdp89N9g3mCsZjaGmDDRdcTnZh9u3vYyBab2tRy": 1000000 | ||
}, | ||
} | ||
}, | ||
"playlist_contents": { | ||
"track_ids": [ | ||
{"track": 6, "time": 1}, | ||
] | ||
}, | ||
} | ||
], | ||
"usdc_purchases": [ | ||
{ | ||
"slot": 4, | ||
"buyer_user_id": 2, | ||
"seller_user_id": 1, | ||
"amount": 1000000, | ||
"content_type": PurchaseType.album, | ||
"content_id": 5, | ||
} | ||
], | ||
} | ||
populate_mock_db(db_mock, test_entities) | ||
|
||
test_actions = { | ||
"playlist_tracks": [ | ||
{"playlist_id": 5, "track_id": 6}, | ||
], | ||
} | ||
populate_mock_db(db_mock, test_actions) | ||
|
||
with db_mock.scoped_session() as session: | ||
args = { | ||
"limit": 10, | ||
"user_id": 2, | ||
"valid_types": [NotificationType.TRACK_ADDED_TO_PURCHASED_ALBUM], | ||
} | ||
u2_notifications = get_notifications(session, args) | ||
assert len(u2_notifications) == 1 | ||
assert ( | ||
u2_notifications[0]["group_id"] | ||
== "track_added_to_purchased_album:playlist_id:5:track_id:6" | ||
) | ||
assert u2_notifications[0]["is_seen"] == False | ||
assert len(u2_notifications[0]["actions"]) == 1 | ||
assert u2_notifications[0]["actions"][0]["data"] == { | ||
"track_id": 6, | ||
"playlist_id": 5, | ||
"playlist_owner_id": 1, | ||
} | ||
|
||
|
||
def test_extended_track_added_to_purchased_album_notification(app): | ||
with app.app_context(): | ||
db_mock = get_db() | ||
|
||
test_entities = { | ||
"users": [{"user_id": i + 1} for i in range(2)], | ||
"tracks": [{"track_id": 6, "owner_id": 1}], | ||
"playlists": [ | ||
{ | ||
"playlist_id": 5, | ||
"playlist_owner_id": 1, | ||
"playlist_name": "name", | ||
"description": "description", | ||
"is_album": True, | ||
"is_stream_gated": True, | ||
"stream_conditions": { | ||
"usdc_purchase": { | ||
"price": 100, | ||
"splits": { | ||
"7gfRGGdp89N9g3mCsZjaGmDDRdcTnZh9u3vYyBab2tRy": 1000000 | ||
}, | ||
} | ||
}, | ||
"playlist_contents": { | ||
"track_ids": [ | ||
{"track": 6, "time": 1}, | ||
] | ||
}, | ||
} | ||
], | ||
"usdc_purchases": [ | ||
{ | ||
"slot": 4, | ||
"buyer_user_id": 2, | ||
"seller_user_id": 1, | ||
"amount": 1000000, | ||
"content_type": PurchaseType.album, | ||
"content_id": 5, | ||
} | ||
], | ||
} | ||
populate_mock_db(db_mock, test_entities) | ||
|
||
test_actions = { | ||
"playlist_tracks": [ | ||
{"playlist_id": 5, "track_id": 6}, | ||
], | ||
} | ||
populate_mock_db(db_mock, test_actions) | ||
|
||
with db_mock.scoped_session() as session: | ||
args = { | ||
"limit": 10, | ||
"user_id": 2, | ||
"valid_types": [NotificationType.TRACK_ADDED_TO_PURCHASED_ALBUM], | ||
} | ||
u2_notifications = get_notifications(session, args) | ||
extended_notification = extend_notification(u2_notifications[0]) | ||
assert extended_notification["type"] == "track_added_to_purchased_album" | ||
assert ( | ||
extended_notification["group_id"] | ||
== "track_added_to_purchased_album:playlist_id:5:track_id:6" | ||
) | ||
assert extended_notification["actions"][0]["specifier"] == "ML51L" | ||
assert ( | ||
extended_notification["actions"][0]["type"] | ||
== "track_added_to_purchased_album" | ||
) | ||
assert extended_notification["actions"][0]["data"] == { | ||
"track_id": "AnlGe", | ||
"playlist_id": "pnagD", | ||
"playlist_owner_id": "7eP5n", | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
packages/mobile/src/assets/animations/iconPlayLoadingSpinner.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"v":"5.7.6","fr":60,"ip":0,"op":301,"w":600,"h":600,"nm":"Comp 1","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"#White","ln":"White","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":-1,"s":[0]},{"t":300,"s":[1800]}],"ix":10},"p":{"a":0,"k":[300,303,0],"ix":2,"l":2},"a":{"a":0,"k":[300,300,0],"ix":1,"l":2},"s":{"a":0,"k":[90,90,100],"ix":6,"l":2}},"ao":0,"hasMask":true,"masksProperties":[{"inv":false,"mode":"n","pt":{"a":0,"k":{"i":[[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0]],"v":[[49,49],[49,325.346],[326.457,325.346],[326.457,49]],"c":true},"ix":1},"o":{"a":0,"k":100,"ix":3},"x":{"a":0,"k":0,"ix":4},"nm":"Mask 1"}],"shapes":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0.516,0],[0.27,-0.001],[43.768,-37.717],[3.381,-71.148],[0.004,-0.067],[0,-3.994],[0,0],[0,-0.091],[-13.789,0],[0,0],[0.011,13.807],[0,0],[-37.964,37.963],[-53.689,0],[-0.433,-0.003],[-0.054,0],[-0.086,13.753],[13.807,0.087],[0,0]],"o":[[-0.271,0],[-62.264,0.197],[-50.566,43.571],[-0.003,0.067],[-0.184,3.948],[0,0],[0,0.09],[0.011,13.794],[0,0],[13.807,-0.021],[0,0],[0,-53.689],[37.963,-37.964],[0.434,0],[0.054,0],[13.733,0],[0.087,-13.807],[0,0],[-0.516,-0.004]],"v":[[300,49],[299.188,49.001],[136.23,109.783],[49.287,287.886],[49.277,288.092],[49,300],[49,300.111],[49,300.383],[73.98,325.346],[74.019,325.346],[99,300.308],[99,300],[157.872,157.872],[300,99],[301.3,99.004],[301.46,99.005],[326.456,74.162],[301.614,49.005],[301.556,49.005]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[1,1,1,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false}],"ip":0,"op":1800,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"#Primary","ln":"Primary","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[300,300,0],"ix":2,"l":2},"a":{"a":0,"k":[16,16,0],"ix":1,"l":2},"s":{"a":0,"k":[1862.478,1862.478,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[8.837,0],[0,8.836],[-8.837,0],[0,-8.837]],"o":[[-8.837,0],[0,-8.837],[8.837,0],[0,8.836]],"v":[[0,16],[-16,0],[0,-16],[16,0]],"c":true},"ix":2},"nm":"Path 2","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"mm","mm":1,"nm":"Merge Paths 1","mn":"ADBE Vector Filter - Merge","hd":false},{"ty":"fl","c":{"a":0,"k":[0.8,0.059000000299,0.877999997606,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[16.011,16.007],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":5,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":1800,"st":0,"bm":0}],"markers":[]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.