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(console): prevent dead loop when list datastore tables #3053

Merged
merged 1 commit into from
Dec 4, 2023

Conversation

jialeicui
Copy link
Contributor

@jialeicui jialeicui commented Dec 1, 2023

Description

react-query uses deep equal to do the optimization
we can not change the cached data.

ref: https://github.com/TanStack/query/blob/dd3f2a718bdeea282ae12db15e1733b48309cc62/src/core/query.ts#L241-L247

// Use prev data if an isDataEqual function is defined and returns `true`
if (this.options.isDataEqual?.(prevData, data)) {
  data = prevData as TData
} else if (this.options.structuralSharing !== false) {
  // Structurally share data between prev and new data if needed
  data = replaceEqualDeep(prevData, data)
}

The response contains many status fields we do not need, use resp.data as the dependency.

Modules

  • UI
  • Controller
  • Agent
  • Client
  • Python-SDK
  • Others

Checklist

  • run code format and lint check
  • add unit test
  • add necessary doc

Copy link

codecov bot commented Dec 1, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (24d2acc) 82.94% compared to head (30b8757) 72.09%.
Report is 8 commits behind head on main.

Additional details and impacted files
@@              Coverage Diff              @@
##               main    #3053       +/-   ##
=============================================
- Coverage     82.94%   72.09%   -10.86%     
=============================================
  Files           567        3      -564     
  Lines         31434      215    -31219     
  Branches       1839       61     -1778     
=============================================
- Hits          26074      155    -25919     
+ Misses         4549       58     -4491     
+ Partials        811        2      -809     
Flag Coverage Δ
console 72.09% <ø> (ø)
controller ?
standalone ?
unittests 72.09% <ø> (-19.53%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jialeicui jialeicui added bug 🐛 Something isn't working console 🎨 console labels Dec 1, 2023
@tianweidut tianweidut merged commit b6fc2d5 into star-whale:main Dec 4, 2023
17 checks passed
@jialeicui jialeicui deleted the fix-console branch December 4, 2023 03:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something isn't working console 🎨 console
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants