Skip to content

Fix: avoid backend exit#1327

Merged
MarceloRobert merged 2 commits into
mainfrom
fix/avoid-backend-exit
Jul 8, 2025
Merged

Fix: avoid backend exit#1327
MarceloRobert merged 2 commits into
mainfrom
fix/avoid-backend-exit

Conversation

@MarceloRobert
Copy link
Copy Markdown
Contributor

@MarceloRobert MarceloRobert commented Jul 4, 2025

The kcidb_execute_query allows for a sys.exit since it was only used in a command context. Since it is now used in the full backend context, it should be avoided in order to allow for an error 500 instead of exiting the backend

Changes

  • Replaced kcidb_execute_query with the usual cursor and dictfetchall

How to test

  • Go to the kciSummary endpoint and compare queries on staging and locally, they should both still work
  • Also compare the notifications command before and after the change

Closes #1328

@MarceloRobert MarceloRobert self-assigned this Jul 4, 2025
@MarceloRobert MarceloRobert force-pushed the fix/avoid-backend-exit branch from 8113366 to adcd19d Compare July 7, 2025 14:30
Comment on lines +442 to +444
for option in options:
match option:
case "ignore_default_recipients":
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we simplify this to:

Suggested change
for option in options:
match option:
case "ignore_default_recipients":
if "ignore_default_recipients" in options:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

@MarceloRobert MarceloRobert force-pushed the fix/avoid-backend-exit branch from adcd19d to 2f7b2a6 Compare July 7, 2025 16:58
A lower complexity is needed so that the linter doesn't complain with future functionalities
The kcidb_execute_query allows for a sys.exit since it was only used in a command context. Since it is now used in the full backend context, it should be avoided in order to allow for an error 500 instead of exiting the backend

Closes #1328
@MarceloRobert MarceloRobert force-pushed the fix/avoid-backend-exit branch from 2f7b2a6 to a40a5e5 Compare July 8, 2025 12:28
@MarceloRobert MarceloRobert merged commit a40a5e5 into main Jul 8, 2025
5 checks passed
@MarceloRobert MarceloRobert deleted the fix/avoid-backend-exit branch July 10, 2025 16:07
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

Successfully merging this pull request may close these issues.

Avoid backend exit and return correct error

3 participants