Skip to content

[NIFI-13099] status history error handling#8703

Merged
mcgilman merged 12 commits intoapache:mainfrom
rfellows:NIFI-13099-statusHistoryErrorHandling
Apr 29, 2024
Merged

[NIFI-13099] status history error handling#8703
mcgilman merged 12 commits intoapache:mainfrom
rfellows:NIFI-13099-statusHistoryErrorHandling

Conversation

@rfellows
Copy link
Copy Markdown
Contributor

NIFI-13099

Introduced error handling for:

  • Status History
  • Current User
  • Extension Types
  • Flow Configuration
  • Component State
  • Cluster Summary
  • System Diagnostics

@mcgilman
Copy link
Copy Markdown
Contributor

Will review...

@rfellows rfellows force-pushed the NIFI-13099-statusHistoryErrorHandling branch from 8e3233b to 23d4d37 Compare April 26, 2024 18:00
Copy link
Copy Markdown
Contributor

@mcgilman mcgilman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR @rfellows! Left a few questions below.

})),

on(systemDiagnosticsApiError, (state, { error }) => ({
on(systemDiagnosticsBannerError, (state) => ({
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we also be setting status to error when reported through the snackbar?

of(
ComponentStateActions.componentStateApiError({
error: error.error
ErrorActions.snackBarError({
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be a banner when it happens following clearComponentState?

catchError((errorResponse: HttpErrorResponse) => {
if (request.source === 'cluster-listing') {
return of(
ErrorActions.snackBarError({
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be a banner on top of the cluster page since what is failing to load the content for the page (if they are on one of the system diagnostics tabs)?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. Probably yes. However I don't think we want to make it conditional based on which tab is open.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After further consideration, this presents a potential issue with the cluster listing and the system diagnostics dialog are both open and both showing the same banner error(s). Sticking with snackbar errors in this case until we have contextual banner errors.

Copy link
Copy Markdown
Contributor

@mcgilman mcgilman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the updates @rfellows! I noticed a few more minor things below.


export interface SystemDiagnosticsRequest {
nodewise: boolean;
errorStrategy: 'banner' | 'snackbar';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think the errorStrategy is needed when opening this from navigation. Can we either have a different action payload for reload (where errorStrategy is needed) or have it be optional here.

request: {
nodewise: false
nodewise: false,
errorStrategy: 'banner'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

errorStrategy shouldn't be needed for getSystemDiagnosticsAndOpenDialog.

loadClusterListingSuccess$ = createEffect(() =>
this.actions$.pipe(
ofType(ClusterListingActions.loadClusterListingSuccess),
concatLatestFrom(() => this.store.select(selectCurrentUser)),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

concatLatestFrom is imported from the wrong package. I also noticed that systemDiagnosticsService is injected in the constructor here but is not used anymore.

@rfellows rfellows force-pushed the NIFI-13099-statusHistoryErrorHandling branch from 0c5bd80 to 2fb3aca Compare April 29, 2024 17:14
Copy link
Copy Markdown
Contributor

@mcgilman mcgilman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the updates @rfellows! Noticed a couple more minor things.

Comment on lines 92 to 96
ErrorActions.snackBarError({
error: `Failed to load System Diagnostics. - [${
errorResponse.error || errorResponse.status
}]`
})
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this needs to be using systemDiagnosticsSnackbarError otherwise the status stays in loading.

Comment on lines +38 to +41
export const selectStatusHistoryStatus = createSelector(
selectStatusHistoryState,
(state: StatusHistoryState) => state.status
);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is new in this PR and is not used.

Copy link
Copy Markdown
Contributor

@mcgilman mcgilman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the updates @rfellows! Will merge once CI completes.

@mcgilman mcgilman merged commit 658e83b into apache:main Apr 29, 2024
shubhluck pushed a commit to shubhluck/nifi that referenced this pull request Jun 1, 2024
* [NIFI-13099] - Error handling for Status History

* Error handling for current user

* Error handling for extension types

* Error handling for flow configuration

* Error handling for component state

* Error handling for cluster summary

* Error handling for System Diagnostics

* review feedback

* use SystemDiagnosticsActions.systemDiagnosticsSnackbarError

* review feedback

* review feedback

* use snackbar

This closes apache#8703
shubhluck pushed a commit to shubhluck/nifi that referenced this pull request Jun 1, 2024
* [NIFI-13099] - Error handling for Status History

* Error handling for current user

* Error handling for extension types

* Error handling for flow configuration

* Error handling for component state

* Error handling for cluster summary

* Error handling for System Diagnostics

* review feedback

* use SystemDiagnosticsActions.systemDiagnosticsSnackbarError

* review feedback

* review feedback

* use snackbar

This closes apache#8703
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ui Pull requests for work relating to the user interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants