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

Bugfix update_project api route #355

Merged
merged 2 commits into from
Feb 14, 2024
Merged

Bugfix update_project api route #355

merged 2 commits into from
Feb 14, 2024

Conversation

Alienmaster
Copy link
Member

After some digging i discovered the following problem:
When querying the database for the project the return value seems to be fine and can be interpret by the fastapi jsonable_encoder.
But when the method _get_action_state_from_orm is called before the jsonable_encode the db_obj seems to change its state.
This is not obvious for me since the method only returns the db_obj as a dict.
If now the jsonable_encoder is called it ends in a RecursionError by the jsonable_encoder.

A quickfix is to convert the db_obj to a dict and then use the jsonable_encoder like in the PR.

There seems to be a known problem in the jsonable_encoder: fastapi/fastapi#10359

@Alienmaster Alienmaster linked an issue Feb 13, 2024 that may be closed by this pull request
@floschne floschne merged commit 2ccfebe into mwp_v1 Feb 14, 2024
2 checks passed
@floschne
Copy link
Member

Thanks for the fix! Does this happen in other places, too?

@Alienmaster
Copy link
Member Author

The jsonable_encoder is used in more placed in the backend. The upcoming api tests should cover these cases

@Alienmaster Alienmaster deleted the Bugfix-update_project branch February 19, 2024 17:03
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.

Project update is bugged
2 participants