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

[Discover] Refactor totalHits$ loading state handling to omit race conditions #196114

Merged
merged 14 commits into from
Oct 22, 2024
Merged
Prev Previous commit
Next Next commit
Simplify sending of loading message
  • Loading branch information
kertal authored Oct 21, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 2eef183433f2cc76bc4d241735f9521c63f1cc7e
Original file line number Diff line number Diff line change
@@ -92,15 +92,9 @@ export function fetchAll(
// Mark all subjects as loading
sendLoadingMsg(dataSubjects.main$);
sendLoadingMsg(dataSubjects.documents$, { query });

// histogram for data view mode will send `loading` for totalHits$
if (isEsqlQuery) {
sendLoadingMsg(dataSubjects.totalHits$, {
result: dataSubjects.totalHits$.getValue().result,
});
} else {
sendLoadingMsg(dataSubjects.totalHits$);
}
sendLoadingMsg(dataSubjects.totalHits$, {
result: dataSubjects.totalHits$.getValue().result,
});

// Start fetching all required requests
const response = isEsqlQuery