Fix job filtering crash on tuple module keys#269
Merged
Conversation
A module key can be a `{module, key}` tuple (e.g. `{Bob.Job.BuildDockerErlang,
"amd64"}`). Filtering the queue by such a key built `where: j.module_key in
^[{module, key}]`, and Ecto rejects a single-tuple list because it reads as a
keyword list, raising Ecto.QueryError. In the jobs UI this crashed the
LiveView, which silently re-mounted and dropped the selection, so the filter
appeared to do nothing.
Match each key with `==` so the Term type dumps it as a single value instead of
using `in` over a list.
5de23a7 to
a4b07b9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A module key can be a
{module, key}tuple (e.g.{Bob.Job.BuildDockerErlang, "amd64"}). Filtering the queue by such a key builtwhere: j.module_key in ^[{module, key}], and Ecto rejects a single-tuple list because it reads as a keyword list, raisingEcto.QueryError.In the jobs UI, selecting one of those pills crashed the LiveView, which silently re-mounted and dropped the selection — so the filter appeared to do nothing. It only affected pills for tuple-keyed jobs (the build jobs that carry queue backlog), which is why it reproduced on production but not locally. Tracked in Sentry as BOB-27.
Match each key with
==so the Term type dumps it as a single value instead of usinginover a list.