Skip to content

fix(selectors-hydration): confluence, jira, teams - #1907

Merged
icecrasher321 merged 11 commits into
stagingfrom
fix/selectors-hydration
Nov 12, 2025
Merged

fix(selectors-hydration): confluence, jira, teams#1907
icecrasher321 merged 11 commits into
stagingfrom
fix/selectors-hydration

Conversation

@icecrasher321

Copy link
Copy Markdown
Collaborator

Summary

Fix confluence page selector, jira issues and project selectors, teams chat selectors.

Type of Change

  • Bug fix

Testing

Tested manually with @aadamgough

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercelBot commented Nov 12, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
ProjectDeploymentPreviewCommentsUpdated (UTC)
docsSkippedSkippedNov 12, 2025 0:33am

@greptile-apps

Copy link
Copy Markdown
Contributor

Greptile Overview

Greptile Summary

Fixed critical hydration issues across Confluence, Jira, and Teams selectors by implementing proper state restoration on component mount. The changes address infinite API calls and missing display names when components reload with persisted values.

Key improvements:

  • Teams selector: Added lastRestoredValueRef to prevent infinite restore loops, and implemented display name caching for channels/chats during fetches
  • Confluence/Jira selectors: Added useEffect hooks to fetch item details on mount when value exists but component state is empty (hydration scenario)
  • Display names hook: Updated to fetch individual items instead of lists, fixed API endpoint paths for Wealthbox and Teams
  • Slack selector: Removed redundant hash symbol rendering (now stored in channel name)
  • Jira project selector: Added state tracking and preview card UI

All changes follow consistent patterns for hydration handling and display name caching across selectors.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The changes implement well-tested bug fixes for hydration issues with clear patterns. The use of refs to prevent infinite loops, proper useEffect dependencies, and consistent display name caching follow React best practices. The changes are scoped to fixing specific hydration bugs without introducing new features or architectural changes.
  • No files require special attention

Important Files Changed

File Analysis

FilenameScoreOverview
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel-new/components/editor/components/sub-block/components/file-selector/components/confluence-file-selector.tsx5/5Added useEffect to fetch page info on mount for hydration, standardized file info structure with proper URL construction, added display name caching
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel-new/components/editor/components/sub-block/components/file-selector/components/teams-message-selector.tsx5/5Fixed infinite restore calls by tracking last restored value with ref, added display name caching for channels and chats to improve hydration
apps/sim/hooks/use-display-name.ts5/5Updated API calls to fetch individual items instead of lists, fixed endpoint paths and parameter naming for Wealthbox and Teams

Sequence Diagram

sequenceDiagram
participant User
participant Component as Selector Component
participant Store as DisplayNames Store
participant API as Backend API
Note over Component: On Mount/Hydration
User->>Component: Component loads with existing value
Component->>Component: Check if value & credentials exist
Component->>Store: Check cached display name
alt No cached display name
Component->>API: Fetch access token
API-->>Component: Return access token
Component->>API: Fetch item details (page/issue/chat)
API-->>Component: Return item data
Component->>Store: Cache display name
Component->>Component: Update selectedItem state
else Display name cached
Component->>Component: Use cached name
end
Note over Component: On User Interaction
User->>Component: Opens dropdown
Component->>API: Fetch list of items
API-->>Component: Return items list
Component->>Store: Cache all item names
Component->>Component: Display items
Loading

@greptile-appsgreptile-appsBot left a comment

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.

6 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@icecrasher321
icecrasher321 merged commit 679c341 into stagingNov 12, 2025
9 checks passed
waleedlatif1 pushed a commit that referenced this pull request Nov 12, 2025
* fix(jira): issue and project selector
* fix endpoints
* remove # for selector
* fix chat selector
* add preview card for jira
* fix inf calls for teams
* fix inf teams calls
* inf confluence calls
* fix confluence selector
* add small # back for slack channel selector
* fix wealthbox selector
waleedlatif1 pushed a commit that referenced this pull request Nov 12, 2025
* fix(jira): issue and project selector
* fix endpoints
* remove # for selector
* fix chat selector
* add preview card for jira
* fix inf calls for teams
* fix inf teams calls
* inf confluence calls
* fix confluence selector
* add small # back for slack channel selector
* fix wealthbox selector
@waleedlatif1waleedlatif1 mentioned this pull request Nov 12, 2025
10 tasks
@waleedlatif1
waleedlatif1 deleted the fix/selectors-hydration branch November 18, 2025 01:28
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@icecrasher321