Repository navigation
Conversation
…n workshop-frontend-experimental
Preview:
|
| let credentialsValid = areCredentialsValid(record); | ||
| if (filter?.expiredOnly && credentialsValid) { | ||
| if (seenIds.has(record.id)) { | ||
| subscriber.remove(record.id); |
There was a problem hiding this comment.
A recovery can be lost while the expired notification is still looking up vendor metadata. If markCredentialsRestored() runs while notifyAdd() is awaiting vendor.describe() or getSupportedResources(), this branch sees no seenIds entry and skips the removal. The older call then resumes and adds the now-healthy account, leaving a red dot or reconnect notice with no later event to clear it. Invalidate in-flight adds for the ID on update/delete and check before sending, or recheck the current record after the awaits. The backend test currently waits for the expired add() before restoring; please also cover restoration with the lookup still pending.
| if (disabledGatekeeperSet.has(record.vendorId)) { | ||
| return; // Whole gatekeeper disabled by admin. | ||
| } | ||
| let credentialsValid = areCredentialsValid(record); |
There was a problem hiding this comment.
This makes a healthy Slack connection show as disconnected across the app once its first rotating access token expires. Slack sends grant.accessToken.expires on connect and reconnect (slack.ts:541–547), but successfully refreshes the token without updating the Workshop deadline (slack.ts:631–644). GatekeeperConnectCallback.complete() in packages/workshop-shared/src/gatekeeper.ts:871–876 explicitly distinguishes refreshability from access-token expiry. Before using this deadline for an app-wide warning, handle the legacy Slack timestamps already in storage and make refreshable grants rely on the terminal expiry notification.
| if (!cancelled) setLiveExpired((cur) => (cur?.id === id ? undefined : cur)) | ||
| }, | ||
| () => { | ||
| ready = true |
There was a problem hiding this comment.
If the last expired account is reconnected in another tab while this tab’s WebSocket is down, the replacement subscription sends only ready(). No callback publishes the empty map, so the red dot persists indefinitely; this hook also retains an actionable notice for the recovered account. The classic provider at ExpiredAccountsProvider.tsx:143 has the same empty-snapshot bug. Publish the full snapshot at ready(), including [], and clear any live notice whose ID is absent. This follows the experimental AGENTS.md reconnect pattern: “showing the last account snapshot until the new snapshot arrives.”
| onReconnect: () => { | ||
| const id = liveExpired.id | ||
| dismissLiveExpired(id) | ||
| void api.reconnectAccount(id).then((flow) => openConnectWindow(flow)).catch(() => {}) |
There was a problem hiding this comment.
A blocked popup or a failed reconnect RPC makes the island disappear without telling the user what went wrong or letting them retry there. openConnectWindow() explicitly throws when the popup is blocked; the Connections page already keeps its dialog open and shows that error. Guard this action with connection.blocked() (see the lost-connection rule in packages/workshop-frontend-experimental/AGENTS.md:118–120), and keep the notice actionable with an error on failure, or take the user to the existing reconnect dialog.
| <span className="relative inline-flex"> | ||
| <Button | ||
| aria-label={expired > 0 ? `Connect an app (${expired} ${expired === 1 ? 'connection needs' : 'connections need'} reconnection)` : 'Connect an app'} | ||
| title={expired > 0 ? expiredTitle : undefined} |
There was a problem hiding this comment.
The service names are only in a native title, so a sighted keyboard user can focus the button but cannot reliably see which services expired. The accessible label conveys only the count. Use the shared Tooltip on the button in both variants, as WorkspaceRailItem does, so the summary is available on focus as well as hover.
|
Review: 5 findings. Posted all five as inline comments on PR #1337. |
Surfaces expired gatekeeper connections across both UIs without making any gatekeeper RPCs for healthy accounts:
workshop-shared,workshop-backend): AddsexpiredOnly?: booleantoConnectedAccountsFilterinsubscribeConnectedAccounts(). Healthy accounts short-circuit synchronously from User DO storage (0 gatekeeper RPCs), emittingadd()only for expired accounts andremove(id)on recovery.workshop-frontend):ExpiredAccountsProviderinroutes/__root.tsxsubscribed with{ expiredOnly: true }.<Plug />button (SidebarUtilityStrip).<ExpiredGatekeepersButton />in workspace/gadget views (GadgetEditor,GadgetUseView) where no sidebar is visible (renders nothing when all accounts are healthy).openConnectWindow(reconnectAccount(id))) that fires only for healthy → expired transitions afterready()(quiet on initial page load) and auto-closes on recovery.workshop-frontend-experimental):useExpiredAccounts()hook subscribed with{ expiredOnly: true }.ConnectButtonand collapsed-railSidebarbutton).ConnectionIsland(<Service> disconnected+ Reconnect action), quiet on initial load and auto-dismissed on recovery.