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

Updating usePolling to cleanup after unmount #1598

Merged
merged 3 commits into from
Mar 20, 2024

Conversation

sejli
Copy link
Member

@sejli sejli commented Mar 20, 2024

Description

  • A simpler fix that achieves the same thing as Lifting useLoadTableColumnsToCache out of Flyouts #1586
  • When the component that initializes usePolling() unmounts before stopPolling() is called, it causes the setInterval to become a zombie process in the background. Updated the hook such that we check if unmounted before exiting the startPolling() function and clear if true.
  • Updated UI for empty state
  • Allow failed cache state to start reloading

Issues Resolved

N/A

Check List

  • New functionality includes testing.
    • All tests pass, including unit test, integration test and doctest
  • New functionality has been documented.
    • New functionality has javadoc added
    • New functionality has user manual doc added
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Copy link

codecov bot commented Mar 20, 2024

Codecov Report

Attention: Patch coverage is 75.00000% with 4 lines in your changes are missing coverage. Please review.

Project coverage is 57.77%. Comparing base (2bc9c17) to head (e2abfe3).

Files Patch % Lines
...nage/associated_objects/associated_objects_tab.tsx 80.00% 2 Missing ⚠️
public/components/hooks/use_polling.ts 66.66% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1598      +/-   ##
==========================================
+ Coverage   57.76%   57.77%   +0.01%     
==========================================
  Files         367      367              
  Lines       13808    13819      +11     
  Branches     3621     3627       +6     
==========================================
+ Hits         7976     7984       +8     
- Misses       5769     5772       +3     
  Partials       63       63              
Flag Coverage Δ
dashboards-observability 57.77% <75.00%> (+0.01%) ⬆️

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.

…hecker in associated objects tab

Signed-off-by: Sean Li <[email protected]>
@ps48 ps48 merged commit a03bf43 into opensearch-project:main Mar 20, 2024
15 of 20 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Mar 20, 2024
* clear interval when component unmounts

Signed-off-by: Sean Li <[email protected]>

* updating empty state

Signed-off-by: Sean Li <[email protected]>

* adding back button on empty page, fixing empty accelerations length checker in associated objects tab

Signed-off-by: Sean Li <[email protected]>

---------

Signed-off-by: Sean Li <[email protected]>
(cherry picked from commit a03bf43)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
opensearch-trigger-bot bot pushed a commit that referenced this pull request Mar 20, 2024
* clear interval when component unmounts

Signed-off-by: Sean Li <[email protected]>

* updating empty state

Signed-off-by: Sean Li <[email protected]>

* adding back button on empty page, fixing empty accelerations length checker in associated objects tab

Signed-off-by: Sean Li <[email protected]>

---------

Signed-off-by: Sean Li <[email protected]>
(cherry picked from commit a03bf43)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
ps48 pushed a commit that referenced this pull request Mar 21, 2024
* clear interval when component unmounts



* updating empty state



* adding back button on empty page, fixing empty accelerations length checker in associated objects tab



---------


(cherry picked from commit a03bf43)

Signed-off-by: Sean Li <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
ps48 pushed a commit that referenced this pull request Mar 21, 2024
* clear interval when component unmounts



* updating empty state



* adding back button on empty page, fixing empty accelerations length checker in associated objects tab



---------


(cherry picked from commit a03bf43)

Signed-off-by: Sean Li <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
RyanL1997 added a commit to RyanL1997/dashboards-observability that referenced this pull request Apr 18, 2024
…er (opensearch-project#1596) (opensearch-project#1598)

Signed-off-by: Ryan Liang <[email protected]>
(cherry picked from commit 1e7b4213551b6ecc4422fa9043c249521c1636bb)

Co-authored-by: Ryan Liang <[email protected]>
amsiglan pushed a commit to amsiglan/dashboards-observability that referenced this pull request Jun 7, 2024
opensearch-project#1601)

* clear interval when component unmounts

* updating empty state

* adding back button on empty page, fixing empty accelerations length checker in associated objects tab

---------

(cherry picked from commit a03bf43)

Signed-off-by: Sean Li <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
(cherry picked from commit 1f78915)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants