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

v2.19.0 introduced a breaking change #3090

Closed
vaind opened this issue Jul 12, 2024 · 3 comments
Closed

v2.19.0 introduced a breaking change #3090

vaind opened this issue Jul 12, 2024 · 3 comments

Comments

@vaind
Copy link

vaind commented Jul 12, 2024

Describe the bug

QueryExecutor.beginExclusive was added in v2.19.0 which is a breaking change in a non-major release.

class SentryQueryExecutor extends QueryExecutor {
      ^^^^^^^^^^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/drift-2.19.0/lib/src/runtime/executor/executor.dart:62:17: Context: 'QueryExecutor.beginExclusive' is defined here.
  QueryExecutor beginExclusive();
                ^^^^^^^^^^^^^^
../../drift/lib/src/sentry_transaction_executor.dart:8:7: Error: The non-abstract class 'SentryTransactionExecutor' is missing implementations for these members:
 - QueryExecutor.beginExclusive
Try to either
 - provide an implementation,
 - inherit an implementation from a superclass or mixin,
 - mark the class as abstract, or
 - provide a 'noSuchMethod' implementation.
@buenaflor
Copy link

I added a fix in the sentry repo: getsentry/sentry-dart#2162

@simolus3
Copy link
Owner

Sorry about the breakage! I've considered this when making the change, but as the docs of QueryExecutor mention:

This is an internal api of drift, which can break often. If you want to implement custom database backends, consider using the new backends API.

QueryExecutor is kind of internal in the sense that it's not meant to be implemented directly. So I didn't consider this to be breaking, but obviously I should do a better job pointing that out, as the docstring is not really all that visible. I will also keep this in mind for further changes.

For sentry, which I assume is wrapping an existing implementation to add instrumentation, I suggest using the QueryInterceptor class instead. Ideally that should also make the implementation a bit simpler since you don't need to add different classes for transactions and so on. But the fix adding beginExclusive works too of course.

@buenaflor
Copy link

@simolus3 all good!

iirc you've added the interceptor after we've talked about the drift integration so we didn't have that option back then but I'll deprecate the current api soon in favour of using the interceptor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants