Skip to content

fix(providers): use nullish coalescing for config defaults#196

Merged
abhay-ramesh merged 2 commits intomainfrom
fix/provider-config-nullish-coalescing
Apr 7, 2026
Merged

fix(providers): use nullish coalescing for config defaults#196
abhay-ramesh merged 2 commits intomainfrom
fix/provider-config-nullish-coalescing

Conversation

@abhay-ramesh
Copy link
Copy Markdown
Owner

What does this PR do?

Fixes || to ?? in the provider config builder. The || operator treats false, 0, and "" as falsy and falls through to defaults, silently overriding explicit user config:

// Before: user sets forcePathStyle: false, but || treats it as falsy
result[key] = config[key] || spec.defaults[key] || "";
// forcePathStyle becomes "" (default), not false

// After: only null/undefined trigger fallback
result[key] = config[key] ?? spec.defaults[key] ?? "";
// forcePathStyle stays false

Affected configs:

  • forcePathStyle: false — needed for virtual-hosted-style URLs (DigitalOcean Spaces, Backblaze B2)
  • useSSL: false — needed for local MinIO without TLS
  • Any boolean or numeric config value set to a falsy value

How was it tested?

  • All 172 tests pass
  • Type-check clean

The provider config builder used || to fall back to defaults, which
silently overrode falsy values like false, 0, and "". This meant
forcePathStyle: false and useSSL: false were ignored and replaced
with defaults. Switch to ?? so only null/undefined trigger fallback.
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Apr 7, 2026

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

Project Deployment Actions Updated (UTC)
pushduck Ready Ready Preview, Comment Apr 7, 2026 8:29pm

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 7, 2026

Warning

Rate limit exceeded

@abhay-ramesh has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 2 minutes and 10 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 2 minutes and 10 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 21416bb8-7599-4314-8d3f-026234357f5e

📥 Commits

Reviewing files that changed from the base of the PR and between 15809b6 and 177d9d7.

📒 Files selected for processing (1)
  • packages/pushduck/src/core/providers/providers.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/provider-config-nullish-coalescing

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@abhay-ramesh abhay-ramesh merged commit 1739584 into main Apr 7, 2026
3 of 4 checks passed
@abhay-ramesh abhay-ramesh deleted the fix/provider-config-nullish-coalescing branch April 7, 2026 20:20
Sign up for free to 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