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

refactor(core): remove duplicated overtime intervals #6626

Open
wants to merge 7 commits into
base: next
Choose a base branch
from

Conversation

aliemir
Copy link
Member

@aliemir aliemir commented Jan 2, 2025

PR Checklist

Please check if your PR fulfills the following requirements:

Bugs / Features

Changes

Added missing enabled prop to useLoadingOvertime and added ability to globally configure through options.overtime.enabled.

Due to the nature of calculating elapsed time, an interval is set by the interval prop. This was causing unwanted updates in the return value and there was no way to disable it properly.

Updated Refine's data hooks and extensions to prevent duplicated overtime intervals from being created. This uses the enabled prop to prevent internal hooks from registering the intervals.

Prior to this change, useTable was initializing its own useLoadingOvertime hook but also propagated the elapsedTime from useList hook which is used internally by useTable. This caused duplicated intervals and unwanted updates.

This now ensures a single interval is created and used for the extension hooks.

WIP Extension hooks from packages outside @refinedev/core; such as @refinedev/antd doesn't export overtime values properly.

Fixes #6625

@aliemir aliemir added this to the January 2025 🎄 milestone Jan 2, 2025
@aliemir aliemir requested a review from a team as a code owner January 2, 2025 13:57
@aliemir aliemir self-assigned this Jan 2, 2025
Copy link

changeset-bot bot commented Jan 2, 2025

🦋 Changeset detected

Latest commit: 9cf1d91

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@refinedev/core Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

netlify bot commented Jan 2, 2025

Deploy Preview for refine-doc-live-previews ready!

Name Link
🔨 Latest commit 7dae0c6
🔍 Latest deploy log https://app.netlify.com/sites/refine-doc-live-previews/deploys/67769b3009e7bc00085c03c1
😎 Deploy Preview https://deploy-preview-6626--refine-doc-live-previews.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@aliemir aliemir changed the base branch from main to next January 2, 2025 13:57
Copy link
Contributor

github-actions bot commented Jan 2, 2025

Copy link

cypress bot commented Jan 2, 2025

refine    Run #11816

Run Properties:  status check passed Passed #11816  •  git commit 0efc95eb6d ℹ️: Merge 9cf1d91099d7c86be4181efd0827cc1b06e3cbde into 944031c600e653dd9ffa7bd982c8...
Project refine
Branch Review refactor/remove-duplicate-overtime
Run status status check passed Passed #11816
Run duration 19m 15s
Commit git commit 0efc95eb6d ℹ️: Merge 9cf1d91099d7c86be4181efd0827cc1b06e3cbde into 944031c600e653dd9ffa7bd982c8...
Committer Ali Emir Şen
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 22
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 378
View all changes introduced in this branch ↗︎

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.

[BUG] Duplicated onInterval calls in useTable and unresponsive overtimeOptions.interval prop
3 participants