Commit e73f163
authored
fix(selfhost): guard pg-adapter's rollback so it can't mask the original batch error (#6392)
batch()'s catch block called client.query("ROLLBACK") unguarded, so a
rollback failure (plausible exactly when the original error was a
connection failure) would propagate instead of the real cause. Wrap
it in the same defensive try/catch { ignore } the SQLite adapter's
batch() already uses.
Added an integration test in test/integration/selfhost-pg.test.ts
(gated on PG_TEST_URL) that intercepts a real client's ROLLBACK call
to force it to throw, confirming the original batch error still
surfaces. Verified against a real local Postgres 16 container that
the test genuinely fails without the fix and passes with it.
Closes #62821 parent f2203a2 commit e73f163
2 files changed
Lines changed: 37 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | | - | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
75 | 79 | | |
76 | 80 | | |
77 | 81 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
62 | 94 | | |
63 | 95 | | |
64 | 96 | | |
| |||
0 commit comments