Commit fe9ecc7
committed
fix(driver-turso)!: refuse
`TursoDriverConfig.timeout` installs its window in exactly one place — the
`fetch` handed to `@libsql/client` inside `createRemoteClient()`. Both remote
sites that consume a caller-supplied `client` (`connect()` and the lazy connect
factory registered on `RemoteTransport`) spell the choice
`this.tursoConfig.client ?? (await this.createRemoteClient())`, so a supplied
client skipped the builder at both and every request ran unbounded, silently,
while `timeout`'s docblock promised "every request the client's HTTP transport
makes" and `client`'s said nothing about the key ceasing to apply.
The constructor now refuses the pair in remote mode as VALIDATION_ERROR / 400
before super(), naming both keys, the mode and both ways out. Controls pin the
width: `client` with no window, a window with no `client`, `timeout: 0`, an
explicit `client: undefined`, and the replica arm — where `sync()` is bounded
whatever client is in use — all stay accepted. Docblocks and README lines that
promised the window unconditionally now say what is refused.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADLdAs2pVcH17h9tZKWMBgtimeout beside a pre-configured client at construction (ADR-0049 enforce-or-remove)1 parent 7c12e47 commit fe9ecc7
4 files changed
Lines changed: 459 additions & 13 deletions
File tree
- .changeset
- packages/drivers/driver-turso
- src
Lines changed: 35 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
163 | 181 | | |
164 | 182 | | |
165 | 183 | | |
| |||
211 | 229 | | |
212 | 230 | | |
213 | 231 | | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
219 | 241 | | |
220 | 242 | | |
221 | 243 | | |
| |||
234 | 256 | | |
235 | 257 | | |
236 | 258 | | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
237 | 264 | | |
238 | 265 | | |
239 | 266 | | |
| |||
0 commit comments