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

FE: Fix refetching data on window focus #380

Merged
merged 9 commits into from
Sep 24, 2024

Conversation

masonwoodford
Copy link
Contributor

@masonwoodford masonwoodford commented May 11, 2024

  • Breaking change? (if so, please describe the impact and migration path for existing application instances)

What changes did you make? (Give an overview)

Closes #348
I created a new constant QUERY_REFETCH_ON_WINDOW_FOCUS_OFF_OPTION that just has refetchOnWindowFocus false rather than

export const QUERY_REFETCH_OFF_OPTIONS = {
refetchOnMount: false,
refetchOnWindowFocus: false,
refetchIntervalInBackground: false,
};

I created this new constant because when all 3 options are provided, even when the Edit field is updated the UI will not reflect the changes until the page is refreshed. I added this constant to the two Edit components that fetch and place into editable fields.

Is there anything you'd like reviewers to focus on?

How Has This Been Tested? (put an "x" (case-sensitive!) next to an item)

  • No need to
  • Manually (please, describe, if necessary)
  • Unit checks
  • Integration checks
  • Covered by existing automation

Checklist (put an "x" (case-sensitive!) next to all the items, otherwise the build will fail)

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (e.g. ENVIRONMENT VARIABLES)
  • My changes generate no new warnings (e.g. Sonar is happy)
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged

Check out Contributing and Code of Conduct

A picture of a cute animal (not mandatory but encouraged)
image

@kapybro kapybro bot added status/triage Issues pending maintainers triage status/triage/manual Manual triage in progress status/triage/completed Automatic triage completed and removed status/triage Issues pending maintainers triage labels May 11, 2024
@masonwoodford masonwoodford changed the title fixes #348 Issues/348 May 11, 2024
@masonwoodford masonwoodford marked this pull request as ready for review May 11, 2024 05:11
@masonwoodford masonwoodford requested a review from a team as a code owner May 11, 2024 05:11
frontend/src/lib/constants.ts Show resolved Hide resolved
frontend/src/lib/hooks/api/topics.ts Outdated Show resolved Hide resolved
@Haarolean Haarolean changed the title Issues/348 FE: Fix refetching data on window focus May 11, 2024
@Haarolean Haarolean added scope/frontend Related to frontend changes type/bug Something isn't working and removed status/triage/manual Manual triage in progress labels May 11, 2024
@masonwoodford
Copy link
Contributor Author

Have updated with the requested changes by passing a parameter to the query functions. I did want to point out that even though the Edit topic component fetches on window focus I don't see it having the issue that Schemas has, but for consistency I added it there but can remove it as well. It also removes unnecessary api requests.

@masonwoodford
Copy link
Contributor Author

Sorry about that didn't mean to re request review didn't see you had requested another review.

@Haarolean Haarolean requested a review from Mgrdich May 25, 2024 18:08
@Haarolean Haarolean merged commit 52451ec into kafbat:main Sep 24, 2024
11 of 12 checks passed
@Haarolean
Copy link
Member

@masonwoodford thank you and sorry for the delay!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope/frontend Related to frontend changes status/triage/completed Automatic triage completed type/bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FE: Do not refetch data on window focus
3 participants