Skip to content

[ENG-8048] Remove caching to avoid incorrect results for ascendants #11169

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ihorsokhanexoft
Copy link
Contributor

@ihorsokhanexoft ihorsokhanexoft commented Jun 4, 2025

Purpose

When user adds a component to a node that has addons with files and registers it, the node doesn't have any archived files. It happens because the child nodes are the first ones to be registered and if a child doesn't have any addons, this empty list would be saved in request.gv_addons attribute that is reused for all other parents and children to avoid making redundant requests to GV. However each child and parent may have its own collection of addons.

Changes

Removed caching

QA Notes

Would be nice to test what happens when a child node has addons with files, but its parent hasn't. Will the parent inherit archived addons files or not?

Ticket

https://openscience.atlassian.net/browse/ENG-8048?atlOrigin=eyJpIjoiMzk1Yjc2MTIyNzQzNDVmYzg4OGE1ODViYjM1NGEyMWIiLCJwIjoiaiJ9

Copy link
Collaborator

@adlius adlius left a comment

Choose a reason for hiding this comment

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

I don't think the caching done here is affecting how files are archived during the registration workflow. Could you take another look?

@ihorsokhanexoft ihorsokhanexoft requested a review from adlius June 6, 2025 12:31
@ihorsokhanexoft
Copy link
Contributor Author

ihorsokhanexoft commented Jun 10, 2025

@adlius pushed a new commit. I implemented it in a bit different way. The reason is that the way you suggested doesn't work because this line processes None as request_helpers.get_addon returns it. I compared implementation of _get_addon_from_gv and get_addon_from_gv and they use different functions that pass value to make_ephemeral_node_settings. Maybe they are incompatible and have to be modified.

def make_ephemeral_node_settings(gv_addon_data: gv_requests.JSONAPIResultEntry, requested_resource, requesting_user):
addon_type = gv_addon_data.resource_type.split('-')[1]

I decided to not change the source code and use an additional cached parameter to control caching and separated fetching addons from GV into _get_addons_from_gv_without_caching

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.

2 participants