fix: handle empty publicStripeKey to prevent frontend crash (#5640)#5641
Open
iroussos25 wants to merge 1 commit intoNangoHQ:masterfrom
Open
fix: handle empty publicStripeKey to prevent frontend crash (#5640)#5641iroussos25 wants to merge 1 commit intoNangoHQ:masterfrom
iroussos25 wants to merge 1 commit intoNangoHQ:masterfrom
Conversation
Contributor
There was a problem hiding this comment.
No issues found; changes appear safe and align with stated goals.
Status: No Issues Found | Risk: Low
Review Details
📁 4 files reviewed | 💬 0 comments
Instruction Files
├── .claude/
│ ├── agents/
│ │ └── nango-docs-migrator.md
│ └── skills/
│ ├── agent-builder-skill/
│ │ ├── EXAMPLES.md
│ │ └── SKILL.md
│ ├── creating-integration-docs/
│ │ └── SKILL.md
│ └── creating-skills-skill/
│ └── SKILL.md
├── AGENTS.md
└── GEMINI.md
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description:
Noticed the crash report in #5640 and wanted to help get this resolved for self-hosted users.
The Fix:
On systems where operational reliability is key, "empty" strings can be more dangerous than "missing" ones. I've updated the environment handling to sanitize empty strings to undefined and added a guardrail in the frontend to prevent the Stripe SDK from initializing (and crashing) without a valid key.
Changes:
Updated WindowEnv interface to allow publicStripeKey to be undefined.
Modified getEnvJs to sanitize empty environment strings to undefined.
Updated stripe.ts to conditionally load the SDK only when a valid key is present.
Closes #5640.
P.S. I recently applied for the Software Engineering role at Nango (Name: Giannis Roussos) . While going through the docs and setting things up, I ran into this issue and figured the best way to introduce myself was with a fix. Looking forward to potentially building more with the team.
This PR also includes a pnpm lockfile update alongside the Stripe-related environment handling changes.
This summary was automatically generated by @propel-code-bot