Commit 5de4bc7
fix(notifications): personalize embedded users in related response
On initial app load the current user's follow relationship to other
accounts (e.g. @audius) renders as not-following in lists hydrated from
notification responses. Visiting that profile directly fixes the state.
The bug: the /notifications/{user_id} endpoint embeds users in the
related field, and the backend personalizes them via getMyId(c) which
reads ?user_id= from the query string, not the URL path. The SDK was
only sending the id in the path, so MyID resolved to 0 and the SQL
short-circuited does_current_user_follow to false for every embedded
user. The tan-query cache primed those entries on a cold notifications
fetch and sticky-cached the wrong follow state until a personalized
profile fetch overwrote them.
The accompanying api PR adds an optional user_id query param to both
/notifications/{user_id} and /notifications/{user_id}/playlist_updates.
This change:
- Regenerates @audius/sdk from the updated spec. The openapi generator
renamed the new query param to `userId2` to avoid colliding with the
path's `userId`. Wire format is correct (`queryParameters['user_id']`),
the field name is just awkward — see PR description for follow-up
options.
- Threads the current user id through both call sites
(useNotifications.ts, usePlaylistUpdates.ts) as `userId2` so the
backend can compute personalization for related.users. Path and query
carry the same value in the normal flow; they may diverge when a
manager reads a managed user's notifications.
The UsersApi.ts diff is incidental drift: getUserForYouFeed was removed
upstream and our generated copy was stale.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>1 parent a80d544 commit 5de4bc7
4 files changed
Lines changed: 19 additions & 65 deletions
File tree
- packages
- common/src/api/tan-query
- notifications
- playlist-updates
- sdk/src/sdk/api/generated/default/apis
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
80 | 84 | | |
81 | 85 | | |
82 | 86 | | |
| |||
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
41 | 43 | | |
42 | 44 | | |
43 | 45 | | |
44 | 46 | | |
| 47 | + | |
45 | 48 | | |
46 | 49 | | |
47 | 50 | | |
48 | | - | |
| 51 | + | |
| 52 | + | |
49 | 53 | | |
50 | 54 | | |
51 | 55 | | |
| |||
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| 39 | + | |
38 | 40 | | |
39 | 41 | | |
40 | 42 | | |
| |||
53 | 55 | | |
54 | 56 | | |
55 | 57 | | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
56 | 62 | | |
57 | 63 | | |
58 | 64 | | |
| |||
100 | 106 | | |
101 | 107 | | |
102 | 108 | | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
103 | 113 | | |
104 | 114 | | |
105 | 115 | | |
| |||
Lines changed: 0 additions & 64 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
686 | 686 | | |
687 | 687 | | |
688 | 688 | | |
689 | | - | |
690 | | - | |
691 | | - | |
692 | | - | |
693 | | - | |
694 | | - | |
695 | | - | |
696 | | - | |
697 | 689 | | |
698 | 690 | | |
699 | 691 | | |
| |||
4175 | 4167 | | |
4176 | 4168 | | |
4177 | 4169 | | |
4178 | | - | |
4179 | | - | |
4180 | | - | |
4181 | | - | |
4182 | | - | |
4183 | | - | |
4184 | | - | |
4185 | | - | |
4186 | | - | |
4187 | | - | |
4188 | | - | |
4189 | | - | |
4190 | | - | |
4191 | | - | |
4192 | | - | |
4193 | | - | |
4194 | | - | |
4195 | | - | |
4196 | | - | |
4197 | | - | |
4198 | | - | |
4199 | | - | |
4200 | | - | |
4201 | | - | |
4202 | | - | |
4203 | | - | |
4204 | | - | |
4205 | | - | |
4206 | | - | |
4207 | | - | |
4208 | | - | |
4209 | | - | |
4210 | | - | |
4211 | | - | |
4212 | | - | |
4213 | | - | |
4214 | | - | |
4215 | | - | |
4216 | | - | |
4217 | | - | |
4218 | | - | |
4219 | | - | |
4220 | | - | |
4221 | | - | |
4222 | | - | |
4223 | | - | |
4224 | | - | |
4225 | | - | |
4226 | | - | |
4227 | | - | |
4228 | | - | |
4229 | | - | |
4230 | | - | |
4231 | | - | |
4232 | | - | |
4233 | | - | |
4234 | 4170 | | |
4235 | 4171 | | |
4236 | 4172 | | |
| |||
0 commit comments