Commit 7ed67a3
fix(identity): bound SDK getUserAccount lookup in authMiddleware
authMiddleware backfills blockchainUserId/handle via a blocking
audiusSdk.full.users.getUserAccount() call whenever the identity user
row is missing those fields - the exact state of a user mid-signup.
During signup the on-chain user is often not yet indexed by discovery,
so the SDK blocks on its internal node selection + retries. The
surrounding try/catch only handles rejection, not a hang, so the whole
request (e.g. POST /users/update) stalls until the client times out.
This path went live in prod on 6/15 once #14474 shipped loadAudiusSdk.cjs
into the build, activating the SDK in authMiddleware for the first time.
Wrap the lookup in a 3s timeout so a slow/hanging discovery lookup
degrades gracefully (logged, then next()) instead of stalling auth on
every authenticated endpoint.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 0f000be commit 7ed67a3
1 file changed
Lines changed: 32 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
14 | 28 | | |
15 | 29 | | |
16 | 30 | | |
| |||
114 | 128 | | |
115 | 129 | | |
116 | 130 | | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
122 | 140 | | |
123 | 141 | | |
124 | 142 | | |
| |||
181 | 199 | | |
182 | 200 | | |
183 | 201 | | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
189 | 211 | | |
190 | 212 | | |
191 | 213 | | |
| |||
0 commit comments