Skip to content

NIFI-15937: Adding support for polling in the connector canvas.#11246

Merged
rfellows merged 1 commit into
apache:mainfrom
mcgilman:NIFI-15937
May 13, 2026
Merged

NIFI-15937: Adding support for polling in the connector canvas.#11246
rfellows merged 1 commit into
apache:mainfrom
mcgilman:NIFI-15937

Conversation

@mcgilman
Copy link
Copy Markdown
Contributor

Summary

NIFI-15937

The Connector canvas previously loaded the flow once on mount and only refreshed in response to user-initiated navigation or actions. As a result, server-side changes that happen passively — bulletins emitted by managed components, queue counts as data flows through, processor run-status transitions — did not appear on the canvas until the user navigated away and back. This change introduces a polling loop modeled on the flow designer's reload pattern so the connector canvas reflects server state without manual interaction.

Behavior

  • A new startConnectorCanvasPolling action is dispatched from ConnectorCanvasComponent#ngOnInit, and a matching stopConnectorCanvasPolling is dispatched from ngOnDestroy. The polling effect drives a 30 second interval and tears down on the stop action so polling never outlives the canvas.
  • A new reloadConnectorFlow action sits between the polling source and loadConnectorFlow. Its effect throttles to one reload per second, resolves the connector id and process group id from canvas state (rather than the route, which can race a navigation), and skips work if the canvas has not yet completed an initial load. This mirrors the flow designer's reloadFlow indirection and keeps the polling source decoupled from which group is currently mounted.
  • The polling tick is gated on DocumentVisibility.Visible so background tabs do not generate load, and on loadingStatus !== 'loading' so a polling reload cannot cancel a user-initiated process group navigation. Without the loading guard the load effect's switchMap would replace the in-flight navigation load with a load of the previously-rendered group, leaving the URL and canvas out of sync.
  • A document-visibility subscription in the effects constructor triggers an immediate reload when the document becomes visible after having been hidden for longer than the polling cadence (30 s). This avoids displaying obviously stale bulletins / status while waiting for the next interval tick. A lastReload timestamp debounces rapid tab switches so they do not each force a fresh load.

Test coverage

connector-canvas.effects.spec.ts and connector-canvas.component.spec.ts are extended to cover the new polling lifecycle (start dispatched on init, stop dispatched on destroy, throttle behavior on reloadConnectorFlow, document-visibility wake-up paths above and below the 30 s threshold, transitions to hidden), as well as a handful of pre-existing coverage gaps that surfaced while writing the polling tests (refreshAfterQueueEmptied$ all-queues-emptied path and missing-connectorId guard, viewComponentConfiguration$ entity-without-operatePermissions fallback, navigateToProvenanceForComponent$ funnel back-navigation, viewProcessorStateAction#canClear Disabled / Invalid / missing-status branches, canDrain / canCancelDrain predicate matrix, and returnToConnectorListing router navigation).

@mcgilman mcgilman added the ui Pull requests for work relating to the user interface label May 13, 2026
Copy link
Copy Markdown
Contributor

@rfellows rfellows left a comment

Choose a reason for hiding this comment

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

Thanks @mcgilman 👍

@rfellows rfellows merged commit 2ea99be into apache:main May 13, 2026
8 checks passed
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