Skip to content

Missing org id check during routing rule order update #1232

Description

@serendipty01

What happened

await db
.updateTable('manual_review_tool.routing_rules')
.set((eb) => ({
sequence_number: sequenceMapping
.reduce(
(acc, seqChange) =>
acc
.when('sequence_number', '=', seqChange.old)
.then(seqChange.new),
// .case() is of type CaseBuilder, but .case().when().then() is of
// type CaseWhenBuilder, so we either have to set the accumulator
// to .case.when().then() and slice the array of changes to skip
// step 1, or cast the accumulator to CaseWhenBuilder. The latter
// seems cleaner.
eb.case() as unknown as CaseWhenBuilder<
ManualReviewToolServicePg,
'manual_review_tool.routing_rules',
unknown,
number
>,
)
.else(eb.ref('sequence_number'))
.end(),
}))
.execute();

it is missing org id condition

coop-010-repro-01.mp4

Version/commit

No response

Affected browser(s)

No response

Relevant logs/errors

Anything else

No response

Screenshots

No response

Checklist

  • I’ve reviewed and agree to follow the code of conduct

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Fields

    Priority

    None yet

    Projects

    • Status
      Todo
    • Status
      Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions