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

fix: fail to save results to the database on subsequent calls in scheduling and reporting #709

Conversation

victorgarcia98
Copy link
Contributor

@victorgarcia98 victorgarcia98 commented Jun 1, 2023

This PR introduces a workaround to get a sensor instance attached to the database session. For more details on this issue, please refer to #683.

Closes #683

…Error

Signed-off-by: Victor Garcia Reolid <victor@seita.nl>
Signed-off-by: Victor Garcia Reolid <victor@seita.nl>
@victorgarcia98 victorgarcia98 self-assigned this Jun 1, 2023
@victorgarcia98 victorgarcia98 changed the title fix: fail to save results to the database on subsequent calls in schduling and reporting fix: fail to save results to the database on subsequent calls in scheduling and reporting Jun 1, 2023
Signed-off-by: Victor Garcia Reolid <victor@seita.nl>
@nhoening nhoening added this to the 0.14.0 milestone Jun 6, 2023
Signed-off-by: Victor Garcia Reolid <victor@seita.nl>
@Flix6x
Copy link
Contributor

Flix6x commented Jun 9, 2023

I will want to backport this PR, which brings up the question of where to add the changelog entry. Normally I backport one version, so this would become a bugfix entry for 0.13.2. But in this case, we may want to backport further, for example, to 0.12.4. The changelog entry would then be duplicated. Any other suggestion?

If not, please add the changelog entry to 0.13.2, and I'll copy it down when backporting further. Any idea which version this bug started occurring?

…save-the-results-to-the-database-on-subsequent-calls
Signed-off-by: Victor Garcia Reolid <victor@seita.nl>
Signed-off-by: Victor Garcia Reolid <victor@seita.nl>
@victorgarcia98
Copy link
Contributor Author

I will want to backport this PR, which brings up the question of where to add the changelog entry. Normally I backport one version, so this would become a bugfix entry for 0.13.2. But in this case, we may want to backport further, for example, to 0.12.4. The changelog entry would then be duplicated. Any other suggestion?

Agree. I feel like we should also mention in which version we actually introduce this fix. That way, users can choose to upgrade to that new version (v0.13.2 in this case) or to the backport of the issue in their corresponding minor version.

@nhoening
Copy link
Contributor

nhoening commented Jun 9, 2023

No idea when this started happening. It might be quite old.

…save-the-results-to-the-database-on-subsequent-calls
@victorgarcia98 victorgarcia98 merged commit b03eb40 into main Jun 9, 2023
@victorgarcia98 victorgarcia98 deleted the 683-trigger-scheduler-api-endpoint-fails-to-save-the-results-to-the-database-on-subsequent-calls branch June 9, 2023 15:56
Flix6x pushed a commit that referenced this pull request Jun 9, 2023
…uent calls in scheduling and reporting (#709)

* fix: get fresh sensor instance to avoid sqlalchemy.exc.InvalidRequestError

Signed-off-by: Victor Garcia Reolid <victor@seita.nl>

* fx: handle the case of not finding the sensor in the datbase

Signed-off-by: Victor Garcia Reolid <victor@seita.nl>

* fix: fetch only when the object is detached

Signed-off-by: Victor Garcia Reolid <victor@seita.nl>

* style: combine if's

Signed-off-by: Victor Garcia Reolid <victor@seita.nl>

* docs: add changelog entry

Signed-off-by: Victor Garcia Reolid <victor@seita.nl>

* docs: move entry from v0.14.0 to v0.13.2

Signed-off-by: Victor Garcia Reolid <victor@seita.nl>

---------

Signed-off-by: Victor Garcia Reolid <victor@seita.nl>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Trigger scheduler API endpoint fails to save the results to the database on subsequent calls
3 participants