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

Resolved an issue where a visualization endpoint intermittently returned the wrong information #1336

Merged
merged 4 commits into from
Dec 13, 2023

Conversation

GiaJordan
Copy link
Contributor

@GiaJordan GiaJordan commented Dec 6, 2023

Was able to repro erroneous behavior on prod, staging, and a local develop api, for visualize/tangled_tree/layers endpoint only.
Behavior was caused because over a session, the value for all_layers in TangledTree.get_tangled_tree_layers would be preserved between requests sent to the endpoint, with the new layer information just being appended to it. The endpoint then takes the first element of the all_layers list after it is returned, assuming that it is a list of length 1. What was actually happening is that the layers for each request were all being returned in this list and so when the first one was returned it could differ from what was requested in the most recent request.

@GiaJordan GiaJordan changed the title Resolve an issue where visualization endpoints intermittently return the wrong information Resolved an issue where visualization endpoints intermittently return the wrong information Dec 6, 2023
@GiaJordan GiaJordan marked this pull request as draft December 6, 2023 16:55
@GiaJordan GiaJordan changed the title Resolved an issue where visualization endpoints intermittently return the wrong information Resolved an issue where a visualization endpoint intermittently returned the wrong information Dec 6, 2023
@GiaJordan GiaJordan marked this pull request as ready for review December 6, 2023 20:53
@linglp
Copy link
Contributor

linglp commented Dec 6, 2023

@GiaJordan thank you for the PR. Could you deploy this to AWS before merging to develop?

@GiaJordan
Copy link
Contributor Author

@linglp it's been deployed to the dev env. behavior is the same as on the local api

@linglp
Copy link
Contributor

linglp commented Dec 11, 2023

@mialy-defelice and @GiaJordan
I think having all_layers default as a list is likely to cause error in save_outputs (see the line here). The post here explains mutable default argument, and I think that's what caused the issue and confusion. Can we make some changes and make sure that all_layers don't get initialized as a list?

@GiaJordan
Copy link
Contributor Author

@linglp that's a good point. I've modified the function according to the docs!

@linglp linglp self-requested a review December 13, 2023 16:24
Copy link
Contributor

@linglp linglp left a comment

Choose a reason for hiding this comment

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

@GiaJordan @mialy-defelice I tested the PR and it looks good to me.

@mialy-defelice mialy-defelice merged commit 4186cc7 into develop Dec 13, 2023
3 checks passed
@mialy-defelice mialy-defelice deleted the develop-viz-api-FDS-1391 branch December 13, 2023 17:17
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.

3 participants