You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat: update conversational agent sample app with personal connection polling - #800
Save fails in standalone sample app — external app token lacks OrchestratorApiUserAccess audience, causing Orchestrator's SetResourceUserOverwrites to reject. Should work fine when widgets runs inside the CAS platform with the platform token.
- URL-encode sessionId in CONNECTION_SESSION_STATUS endpoint
- Serialize polling in JSDoc example (setTimeout instead of setInterval)
- Add console.warn to silent catch in getAddConnectionUrl
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Sample app updates depend on unreleased SDK APIs (sessionId,
getConnectionSessionStatus). Moving to a follow-up PR after
the SDK version is published.
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
All sample app updates moved to feat/jar-10826-sample-app-polling
branch for a follow-up PR after the SDK version is published.
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
- Add cancellation guards for stale agent responses (ChatArea, ConnectionsPanel)
- Serialize polling with recursive setTimeout (ConnectionsPanel)
- Resolve connection state by currentConnectionId, not any enabled connection
- Filter broken/auto-save lists by isConfigurable (ConnectionReadinessCard)
- Disable all Connect buttons while any OAuth flow is active
- Fix "X of Y connections still needed" count
- Add console.warn to all silent catches
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Review summary — one issue flagged inline on ConnectionReadinessCard.tsx:147: stale localConnectors closure in the auto-save payload. The setInterval callback captures localConnectors from the useCallback closure at the time startOAuthFlow runs. If the visibilitychange handler refreshes state between when polling starts and when the success tick fires, updateConnectionSelections sends stale connection IDs for every connector other than the one just connected. Suggested fix: mirror state into a localConnectorsRef and read from the ref inside the interval callback.
Clearing the timer alone does not invalidate an already-running auth or status request, and this effect never reruns when agentId/folderId changes. The old callback can consequently auto-save and replace readiness after the card has switched agents. Invalidate the session during cleanup and reset the connecting state whenever the target identity changes.
This issue also appears in the following locations of the same file:
Using load as the OAuth-success callback silently discards any unsaved picker changes: useConnections.load() replaces both initialSelections and stagedSelections with the server response. If a user changes one row and then adds a connection from another, the first change disappears. Refresh the available connection lists while preserving staged selections (or explicitly merge them) instead of invoking the resetting load path.
This issue also appears on line 164 of the same file.
Review summary — 2 new findings posted as inline comments:
ConnectionReadinessCard.tsx:135 — setInterval with async callback can overlap. The PR description calls out a setInterval-to-setTimeout fix for ConnectionsPanel; the new ConnectionReadinessCard repeats the same pattern. On slow networks, two interval ticks can both observe a success response and both call updateConnectionSelections, causing a double-save race. Fix: convert to recursive setTimeout as done in ConnectionsPanel.
ChatArea.tsx:77 — silent catch. All other catches in this file call console.warn; this one swallows the error from the deferred re-fetch silently, making failures invisible in dev tooling.
Cleanup clears an existing interval but does not invalidate a pending OAuth flow. If the component unmounts while getConnectionAuthUrl is awaiting, its continuation still passes the session check, opens a tab, and creates a new interval after cleanup has already run. Increment oauthSessionRef during cleanup so pending continuations return without side effects.
This issue also appears in the following locations of the same file:
line 157
line 175
Refresh connections without discarding unsaved selections
Refreshing via load after OAuth completion replaces both initialSelections and stagedSelections with server values (useConnections.ts:40-44). If the user has unsaved edits in another row, creating a connection silently discards them. Refresh the available connection list while preserving/merging staged selections instead of invoking the resetting load path.
This issue also appears on line 164 of the same file.
The reason will be displayed to describe this comment to others. Learn more.
Unhandled rejection: getAddConnectionUrl is an await inside a catch block with no surrounding try. If it throws, the error propagates out of the outer catch, and since handleAddConnection is called from a button onClick with no .catch() wrapper, the rejection goes unhandled and shows up as an error in the console.
Wrap the fallback in its own try/catch:
Suggested change
// Fallback to the platform URL if auth endpoint isn't available
ConnectionsPanel.tsx:195–197 — unhandled rejection in fallback path.getAddConnectionUrl is awaited inside a catch block with no try/catch of its own. If it throws, the error escapes the outer catch and becomes an unhandled promise rejection from the button's onClick handler. Fix: wrap in a nested try/catch with a console.warn.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
uipath-typescript
feat/jar-10826-cas-personal-connections-parity-widgets — adds
getConnectionAuthUrl()andgetConnectionSessionStatus()(both@internal) #798sessionIdadded toConnectionAuthResponsegetConnectionSessionStatus()— new method to poll OAuth session completionConnectionSessionStatusResponsetype —pending|success|failedCONNECTION_SESSION_STATUSendpoint@internalcaveat on all 4 connection methods (require user-scoped tokens)Sample app branch (feat/jar-10826-sample-app-polling) —
ConnectionsPanelpolling fix (setInterval→setTimeout), newConnectionReadinessCard,ChatAreastale-response guard,isConfigurablefiltering.feat: update conversational agent sample app with personal connection polling #800
uipath-ui-widgets —
feat/jar-10826-cas-personal-connections-parity-widgetsPorting CAS personal connections UI: UiPath/uipath-ui-widgets#171
ConnectionReadinessCard— 3 states (collapsed/yellow/red), OAuth polling at 500ms for connect buttons, auto-collapseConnectionsSection— settings tab with connection picker, search, grouped by personalWorkspace/folder, dirty tracking, save/cancel, OAuth flow with auth fallbackConversationalAgentChat— fetches readiness on agent init, agent start-up autobinding, race condition guard, clears on send/new chatSettingsDialog— ConnectionsSection accordion itemKnown Limitations (not code bugs)