Change fetch policy for work item detail
What does this MR do and why?
Use cache-and-network
type policy to ensure updates in work items when modal is closed and subscriptions are not active.
Current production behavior before this MR
- Open an issue where work items are linked, either in "linked" section or "tasks" section
- Click on any WI link , see that even before opening , on hover the WI detail is already pre-fetched
- Now close the modal
- Open it again , you can see that there is no fresh graphql call to fetch work item details since it is cached
To check why we are doing what we are doing
- Open an issue where work items are linked, either in "linked" section or "tasks" section
- Open the WI in modal ( WI details are already fetched now and cached), now close the modal
- Now , Open the WI in full view in a new adjacent tab
- now you have 2 tabs , one tab having the issue which has related tasks( with the modal closed) and the adjacent tab being the WI full view
- From the WI full view , now change the weight/ or any other widget
- Come back to the issue full view and open the WI in the modal, see that you cannot view the latest changes made to the modal since the details are cached
What we are trying to do in this MR is changed the fetchPolicy of work item detail, so that everytime some changes are made and the subscriptions are not active ( since the modal is closed ) the new changes are reflected
Before | After |
---|---|
Screen_Recording_2023-04-19_at_12.31.50_PM | Screen_Recording_2023-04-19_at_12.30.24_PM |
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
How to set up and validate locally
Expected changes in prod after this MR
- Open an issue where work items are linked, either in "linked" section or "tasks" section
- Open the WI in modal ( WI details are already fetched now and cached), now close the modal
- Now , Open the WI in full view in a new adjacent tab
- now you have 2 tabs , one tab having the issue which has related tasks( with the modal closed) and the adjacent tab being the WI full view
- From the WI full view , now change the weight/ or any other widget
- Come back to the issue full view and open the WI in the modal, **see that you can the latest changes in the WI **
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Deepika Guliani