feat: handle google stale oauth#8617
Conversation
Added mutation for updating Google integration settings, including handling OAuth redirects and displaying success/error notifications. Enhanced UI with a reconnect button and improved state management for loading and error handling.
…ect functionality Added `oauthStale` field to the GraphQL schema and updated related components to manage OAuth token expiration. Implemented reconnect URL in email templates and service logic, along with UI alerts for stale OAuth status in the integration details view. Updated mocks and types to reflect these changes.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (19)
📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughAdds oauthStale to Google integration schemas, implements stale-OAuth detection in token refresh, queues a google-reconnect email, adds an email template and worker to send reconnect emails, and surfaces staleness + reconnect controls in the admin UI with updated queries, mocks, translations, and tests. Changes
Sequence DiagramsequenceDiagram
participant Client as Admin UI
participant Backend as Backend (Auth)
participant DB as Database
participant Worker as Email Worker
participant User as Email Recipient
Backend->>Backend: Attempt token refresh
alt Refresh fails
Backend->>DB: update integration.oauthStale = true
Backend->>Backend: handleStaleOAuth()
Backend->>Worker: enqueue 'google-reconnect' job (userId, teamId, integrationId, accountEmail)
end
Worker->>DB: fetch user and prefs
alt prefs allow
Worker->>Worker: render GoogleReconnectEmail (HTML + text)
Worker->>User: send reconnect email
end
Client->>DB: query integration (includes oauthStale)
Client->>Client: show stale warning + "Reconnect with Google" button
Client->>Backend: INTEGRATION_GOOGLE_UPDATE mutation (on reconnect)
Backend->>DB: update tokens, set oauthStale = false
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
View your CI Pipeline Execution ↗ for commit fbd9ea2
☁️ Nx Cloud last updated this comment at |
|
View your CI Pipeline Execution ↗ for commit a2ee020
☁️ Nx Cloud last updated this comment at |
This comment has been minimized.
This comment has been minimized.
|
The latest updates on your projects.
|
|
The latest updates on your projects.
|
|
The latest updates on your projects.
|
|
The latest updates on your projects.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@apis/api-gateway/schema.graphql`:
- Around line 1769-1771: The gateway schema declares the oauthStale field with
`@join__field`(graph: API_JOURNEYS) and `@join__field`(graph: API_JOURNEYS_MODERN)
which will route queries to the legacy subgraph incorrectly; update the
oauthStale field declaration so it is routed to the modern subgraph only by
keeping the `@join__field`(graph: API_JOURNEYS_MODERN) and add `@override`(from:
"api-journeys") to indicate the modern subgraph owns the field (locate the
oauthStale field declaration in the schema and replace the dual join__field
directives with the single modern join__field plus the `@override`(from:
"api-journeys") directive).
| accountEmail: String | ||
| oauthStale: Boolean! @join__field(graph: API_JOURNEYS) @join__field(graph: API_JOURNEYS_MODERN) | ||
| } |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Search for oauthStale in legacy and modern schemas
echo "=== Searching in api-journeys schema ==="
rg -n "oauthStale" apis/api-journeys/schema.graphql
echo ""
echo "=== Searching in api-journeys-modern schema ==="
rg -n "oauthStale" apis/api-journeys-modern/schema.graphql
echo ""
echo "=== Searching in api-journeys resolvers ==="
fd -e ts -e js . apis/api-journeys --type f | head -20 | xargs -I {} rg -l "oauthStale" {}
echo ""
echo "=== Searching in api-journeys-modern resolvers ==="
fd -e ts -e js . apis/api-journeys-modern --type f | head -20 | xargs -I {} rg -l "oauthStale" {}Repository: JesusFilm/core
Length of output: 425
🏁 Script executed:
#!/bin/bash
# Get context around oauthStale in modern schema
echo "=== Context around oauthStale in api-journeys-modern ==="
sed -n '695,705p' apis/api-journeys-modern/schema.graphql
echo ""
echo "=== Check if this is in a type that appears in both schemas ==="
sed -n '690,705p' apis/api-journeys-modern/schema.graphql
echo ""
echo "=== Look for override directive examples in gateway schema ==="
rg -n "@override" apis/api-gateway/schema.graphql | head -10
echo ""
echo "=== Check what type oauthStale is part of in gateway ==="
sed -n '1760,1775p' apis/api-gateway/schema.graphqlRepository: JesusFilm/core
Length of output: 1486
Add @override directive to route oauthStale to the modern subgraph.
The oauthStale field exists only in api-journeys-modern but is declared in the gateway with @join__field(graph: API_JOURNEYS) @join__field(graph: API_JOURNEYS_MODERN). This will cause supergraph composition or runtime failures when querying the field through the legacy subgraph. Route it to the modern service using:
oauthStale: Boolean! `@join__field`(graph: API_JOURNEYS_MODERN) `@override`(from: "api-journeys")🤖 Prompt for AI Agents
In `@apis/api-gateway/schema.graphql` around lines 1769 - 1771, The gateway schema
declares the oauthStale field with `@join__field`(graph: API_JOURNEYS) and
`@join__field`(graph: API_JOURNEYS_MODERN) which will route queries to the legacy
subgraph incorrectly; update the oauthStale field declaration so it is routed to
the modern subgraph only by keeping the `@join__field`(graph: API_JOURNEYS_MODERN)
and add `@override`(from: "api-journeys") to indicate the modern subgraph owns the
field (locate the oauthStale field declaration in the schema and replace the
dual join__field directives with the single modern join__field plus the
`@override`(from: "api-journeys") directive).
|
This pull request has been marked stale due to 28 days without activity. It will be closed in 14 days unless updated. |
…rules documentation - Updated .gitignore to include personal Claude rules files. - Removed @types/fluent-ffmpeg from package.json and pnpm-lock.yaml. - Added new CLAUDE rules documentation for backend, frontend, and infrastructure. - Updated post-create and post-start commands to specify pnpm version. - Added health check grace period to service configurations in Terraform locals.
|
This pull request has been marked stale due to 28 days without activity. It will be closed in 14 days unless updated. |
|
This pull request was automatically closed after remaining stale for 14 days. |
Summary by CodeRabbit
New Features
Tests