Skip to content

fix(ui): Fix occasional stale cash when adding/removing multiple data products#16743

Merged
chriscollins3456 merged 1 commit intomasterfrom
cc--cat-1507-fix-dp-lag-updates
Mar 25, 2026
Merged

fix(ui): Fix occasional stale cash when adding/removing multiple data products#16743
chriscollins3456 merged 1 commit intomasterfrom
cc--cat-1507-fix-dp-lag-updates

Conversation

@chriscollins3456
Copy link
Collaborator

Since data products are associated with assets only through the relationships query (which goes through elastic) if you add or remove multiple data products, you're not just updating one aspect, but one for each affected data product. Therefore if you add a few products or one at a time remove multiple, when we refetch after each removal or refetch after the bulk adds, sometimes the data products you get back after that refetch are incorrect, and then get cached that way if you were to go to search results and look at the sidebar and come back.

This PR makes a change where we intentionally bypass the cache for an entity profile data fetch the next time we need it. This is much more reliable than a 3 second hardcoded wait and refetch, because this will simply do a real refetch next time we need it, instead of just hoping it's ready after 3 seconds.

Additionally, with a 3 second wait if a user leaves the page before those 3 seconds are up then the refetch never happens and we are stuck with the previously cached data which does not include the mutation, and we show stale data. Now we always fetch fresh for the given entity the next time we need it.

It's still possible of course if a user leaves really quickly and gets to a spot where we refetch that elastic isn't updated, but that is simply the risk of eventual consistency and reliance on elastic, not much we can do here right now.

I think this approach will be nice for all entity profile mutations that require a 3 second wait and refetch. More efficient and more reliable.

@github-actions github-actions bot added the product PR or Issue related to the DataHub UI/UX label Mar 24, 2026
@github-actions
Copy link
Contributor

Linear: CAT-1607

@alwaysmeticulous
Copy link

alwaysmeticulous bot commented Mar 24, 2026

✅ Meticulous spotted 0 visual differences across 1526 screens tested: view results.

Meticulous evaluated ~9 hours of user flows against your PR.

Expected differences? Click here. Last updated for commit cda32eb. This comment will update as new commits are pushed.

@codecov
Copy link

codecov bot commented Mar 24, 2026

Bundle Report

Changes will increase total bundle size by 514 bytes (0.0%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
datahub-react-web-esm 22.69MB 514 bytes (0.0%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: datahub-react-web-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
assets/index-*.js 514 bytes 12.45MB 0.0%

Files in assets/index-*.js:

  • ./src/app/entityV2/shared/components/styled/search/action/DataProductsDropdown.tsx → Total Size: 2.35kB

  • ./src/app/entityV2/shared/containers/profile/useGetDataForProfile.ts → Total Size: 1.59kB

  • ./src/app/entityV2/shared/containers/profile/sidebar/DataProduct/DataProductSection.tsx → Total Size: 5.11kB

  • ./src/app/entityV2/shared/containers/profile/sidebar/DataProduct/SetDataProductModal.tsx → Total Size: 6.54kB

  • ./src/app/sharedV2/reloadableContext/types.ts → Total Size: 290 bytes

  • ./src/app/sharedV2/reloadableContext/ReloadableContext.tsx → Total Size: 2.04kB

@codecov
Copy link

codecov bot commented Mar 24, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@maggiehays maggiehays added the needs-review Label for PRs that need review from a maintainer. label Mar 25, 2026
@chriscollins3456 chriscollins3456 merged commit 26b6340 into master Mar 25, 2026
59 of 60 checks passed
@chriscollins3456 chriscollins3456 deleted the cc--cat-1507-fix-dp-lag-updates branch March 25, 2026 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-review Label for PRs that need review from a maintainer. product PR or Issue related to the DataHub UI/UX

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants