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: updating alert configuration doesnt reflect immediately #2671

Merged
merged 3 commits into from May 12, 2023

Conversation

ksorv
Copy link
Contributor

@ksorv ksorv commented May 5, 2023

Fixes: #2578

Issue: invalidated query was getting refetched but before that could happen, the form was rendered with initial data as state.. and the new data that came had no effects running.

Hence, the bug. Justify the behaviour also,

  • Update -> Open [Not updated but new data is here] -> Go back -> Come back -> Now its updated

There are two ways to solve it:

  • Wait and show loader til the data comes in so render happens with new data
  • Add an effect so form state gets updated when data coming frop props changes

Went with the first one, as if query takes 5 sec to revalidate it might create conflicting states for user.

Open to suggestions on how to fix it better.

Please let me know

Screen.Recording.2023-05-06.at.12.50.02.AM.mov

Signed-off-by: Saurav Kumar <sauravkhdoolia@gmail.com>
@srikanthccv
Copy link
Member

Is isLoading not set to true when re-fetching happens?

@ksorv
Copy link
Contributor Author

ksorv commented May 8, 2023

No. @srikanthccv as per my knowledge and further drilling on internet:

  • isLoading
    • Is true when the query has no data yet and is fetching for the first time.
  • isFetching
    • Is true whenever a request is in-flight – includes the initial request and subsequent refetches.
  • isRefetching
    • Is true whenever a request is in-flight, but doesn’t include the initial request.

So, either we gotta use isFetching or for better readability and control we can use isLoading and isRefetching

@palashgdev
Copy link
Contributor

Is isLoading not set to true when re-fetching happens?

yeah @ksorv is right

@palashgdev
Copy link
Contributor

Open to suggestions on how to fix it better.

  1. Wait and show the loader til the data comes in so render happens with new data

this would work

@palashgdev palashgdev merged commit e8f2176 into SigNoz:develop May 12, 2023
8 of 11 checks passed
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.

alert configuration change doesn't immediately reflect
3 participants