Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

driver-adapters: Ensure error propogation works for startTransaction #4267

Merged
merged 2 commits into from
Sep 21, 2023

Conversation

SevInf
Copy link
Contributor

@SevInf SevInf commented Sep 21, 2023

startTransaction was not correctly wrapped when converting Adapter
to ErrorCapturingAdapter. As a result, GenericError message was
returned in case of JS error. This PR fixes the problem.

Since it is hard to test those kinds of errors with real drivers, new
test suite for the error propogation is introduced. It uses fake
postgres adapter that throws on every call.

`startTransaction` was not correctly wrapped when converting `Adapter`
to `ErrorCapturingAdapter`. As a result, `GenericError` message was
returned in case of JS error. This PR fixes the problem.

Since it is hard to test those kinds of errors with real drivers, new
test suite for the error propogation is introduced. It uses fake
postgres adapter that throws on every call.
@SevInf SevInf requested a review from a team as a code owner September 21, 2023 11:12
@SevInf SevInf added this to the 5.4.0 milestone Sep 21, 2023
@SevInf SevInf changed the title driver-adapters: Ensure error propohation works for startTransaction driver-adapters: Ensure error propogation works for startTransaction Sep 21, 2023
@codspeed-hq
Copy link

codspeed-hq bot commented Sep 21, 2023

CodSpeed Performance Report

Merging #4267 will degrade performances by 5.51%

Comparing js-connectors/errors-in-start-tx (687c08b) with main (a8d82f7)

Summary

❌ 1 regressions
✅ 10 untouched benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark main js-connectors/errors-in-start-tx Change
large_read 7.3 ms 7.7 ms -5.51%

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<3

@janpio janpio added the topic: driver adapters formerly phase 1 label Sep 21, 2023
}
}
})
const resultSet = await this.doQuery({
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO in a separate PR: remove this class

@aqrln aqrln merged commit 5a6164f into main Sep 21, 2023
@aqrln aqrln deleted the js-connectors/errors-in-start-tx branch September 21, 2023 15:40
Copy link
Contributor

@miguelff miguelff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix and for adding the tests. Changes look correct.

Now I have a more general question.

Should we keep the smoke tests in the light of the query-engine test suite exercising each of the adapters? I think we shouldn’t given the coverage from connector-kit-rs using the js executor, and also the presence of tests in prisma/prisma. WDYT?

@janpio
Copy link
Contributor

janpio commented Sep 21, 2023

They are a quick tool to check things when developing a new driver adapter, and to surface very quickly some fundamental problems. (See the msg I just posted in Slack) I would say we keep them, at least for a while (or forever, as the first way to check if a driver adapter is complete).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: driver adapters formerly phase 1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants