-
Notifications
You must be signed in to change notification settings - Fork 537
feat: add NangoConnection<I> extractor for nango-powered integration routes #3962
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
devin-ai-integration
wants to merge
7
commits into
main
Choose a base branch
from
devin/1771044867-nango-connection-extractor
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
caafc50
feat: add NangoConnection<I> extractor for nango-powered integration …
devin-ai-integration[bot] 90966be
fix: add on_conflict param for PostgREST upsert on nango_connections
devin-ai-integration[bot] cb2b63c
fix: check success flag before deleting nango connection on webhook
devin-ai-integration[bot] c95f899
fix: URL-encode query params in PostgREST requests
devin-ai-integration[bot] 57d2c4d
refactor: extract Supabase DB operations into supabase.rs
devin-ai-integration[bot] 45d8b73
fix: resolve merge conflict with main (stt/llm rate-limit refactor)
devin-ai-integration[bot] 68c1bb5
fix: return 500 on transient DB failures in webhook, add deletion suc…
devin-ai-integration[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
This file was deleted.
Oops, something went wrong.
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,6 @@ | ||
| mod config; | ||
| mod error; | ||
| mod openapi; | ||
| mod routes; | ||
| mod state; | ||
|
|
||
| pub use config::CalendarConfig; | ||
| pub use openapi::openapi; | ||
| pub use routes::router; |
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
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
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
This file was deleted.
Oops, something went wrong.
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,24 @@ | ||
| use hypr_api_env::NangoEnv; | ||
| use hypr_api_env::{NangoEnv, SupabaseEnv}; | ||
|
|
||
| #[derive(Clone)] | ||
| pub struct NangoConfig { | ||
| pub nango: NangoEnv, | ||
| pub supabase_url: String, | ||
| pub supabase_anon_key: String, | ||
| pub supabase_service_role_key: Option<String>, | ||
| } | ||
|
|
||
| impl NangoConfig { | ||
| pub fn new(nango: &NangoEnv) -> Self { | ||
| pub fn new( | ||
| nango: &NangoEnv, | ||
| supabase: &SupabaseEnv, | ||
| supabase_service_role_key: Option<String>, | ||
| ) -> Self { | ||
| Self { | ||
| nango: nango.clone(), | ||
| supabase_url: supabase.supabase_url.clone(), | ||
| supabase_anon_key: supabase.supabase_anon_key.clone(), | ||
| supabase_service_role_key, | ||
| } | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔴 Duplicate
supabase_service_role_keyfield shadows flattenedSupabaseEnv, causing app startup crashAdding
supabase_service_role_key: Option<String>as a named field onEnv(line 19) conflicts with the same field inside#[serde(flatten)] pub supabase: hypr_api_env::SupabaseEnv(line 22), which also containssupabase_service_role_key: String(crates/api-env/src/lib.rs:23).Root Cause
When serde processes
#[serde(flatten)], it first matches each key in the input map against explicitly-named fields. The keysupabase_service_role_keymatches the new top-levelOption<String>field and is consumed. The remaining (unmatched) keys are then forwarded to flattened structs. Because the key has already been consumed,SupabaseEnvnever seessupabase_service_role_key, and since that field is a requiredString(notOption), deserialization ofSupabaseEnvfails.This makes
envy::from_env().expect("Failed to load environment")atapps/api/src/env.rs:55panic on startup, crashing the application.Impact: The API server cannot start at all. This is a complete regression.
Fix: Remove the new
supabase_service_role_keyfield fromEnvand instead passSome(env.supabase.supabase_service_role_key.clone())inmain.rswhereNangoConfig::newis called, sinceSupabaseEnvalready provides this value as a required field.Prompt for agents
Was this helpful? React with 👍 or 👎 to provide feedback.