fix(env): schema treatment of empty string for redis url#4862
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryLow Risk Overview The change is a Reviewed by Cursor Bugbot for commit 348ab13. Configure here. |
Greptile SummaryThis PR fixes a validation failure in the realtime app's env schema when Docker Compose injects
Confidence Score: 5/5Safe to merge — the change is a targeted one-line schema fix with no side effects on other env fields. The fix is minimal and correct: z.preprocess converts empty/whitespace strings to undefined before the URL validator runs, which is the standard Zod idiom for this pattern. The typeof value === 'string' guard prevents unexpected coercion of non-string inputs. No other fields in this schema are affected. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[process.env.REDIS_URL] --> B{preprocess}
B -->|empty or whitespace string| C[undefined]
B -->|non-empty string| D[original value]
C --> E{url validator - optional}
D --> E
E -->|undefined| F[Valid - Redis disabled]
E -->|valid URL| G[Valid - Redis enabled]
E -->|invalid URL| H[Validation error thrown]
Reviews (1): Last reviewed commit: "fix(env): schema treatment of empty stri..." | Re-trigger Greptile |
Summary
Docker compose injects as empty string which leads to failures if redis not setup.
Type of Change
Testing
N/A
Checklist