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

Missing oban: true Repo opts in some queries? #1142

Closed
durub opened this issue Aug 20, 2024 · 1 comment
Closed

Missing oban: true Repo opts in some queries? #1142

durub opened this issue Aug 20, 2024 · 1 comment
Labels
area:pro Related to Oban Pro closed:duplicate This is a duplicate issue kind:bug Something isn't working

Comments

@durub
Copy link

durub commented Aug 20, 2024

Environment

  • Oban 2.18.2 / Oban Pro 2.15.0-rc.1
  • PostgreSQL 15.6
  • Elixir 1.16.2 (compiled with Erlang/OTP 26)

Current Behavior

I'm unsure if this may be an oversight or if it's expected behaviour.

The Producer queries in Oban.Pro.Engines.Smart.refresh/2 does not seem to pass [oban: true] in the Repo query opts.

Is this by design? I'm not sure if oban: true is used only in certain queries or if it should apply to all queries.

Expected Behavior

I use this information in our Repo.prepare_query/3 to process Oban queries differently. Something like this: https://hexdocs.pm/ecto/multi-tenancy-with-foreign-keys.html

Checking opts[:oban] was fine until this upgrade. After upgrading to 2.15.0-rc.1, it seems exceptions are now being raised in our code base when handling oban_producers queries. I added a workaround to process all oban_* tables differently and it's running smoothly now.

The Producer queries in Oban.Pro.Engines.Smart.refresh/2 sets oban in Repo query opts to true so the user can use this information to identify Oban queries in Repo.prepare_query/3.

@sorentwo
Copy link
Member

This was a mistake introduced in RC.1 by the use of a Multi. Mutli's don't use options passed to the transaction, which caused it to omit the [oban: true] opts.

This is fixed in main and will be out with RC.2 today or tomorrow.

@sorentwo sorentwo added kind:bug Something isn't working area:pro Related to Oban Pro closed:duplicate This is a duplicate issue labels Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:pro Related to Oban Pro closed:duplicate This is a duplicate issue kind:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants