Skip to content

Conversation

@anuragchvn-blip
Copy link

Description

Fixes build failures when Salesforce credentials are not configured by gracefully returning empty array in getGrantInitiativeItems().

Changes

  • Graceful credential handling: Added check at start of getGrantInitiativeItems() to return empty array when credentials missing
  • Build-time fallback: Allows static site generation to succeed without Salesforce connection
  • Runtime generation: Pages use ISR with fallback: 'blocking' to generate on first request when credentials available

Impact

  • Enables CI/CD builds without credentials
  • Fixes local development build failures
  • Maintains production functionality via runtime page generation

Testing

Verified npm run build succeeds with:

  • 41 pages generated successfully
  • Warning logs for missing credentials
  • No errors during build process

- Centralized Salesforce credential management to prevent exposure
- Added pre-flight file size validation to prevent DOS attacks
- Implemented numeric field sanitization for data integrity
- Enhanced error handling with structured JSON responses
- Added credential validation with fail-fast pattern
- Upgraded critical error logging for monitoring systems

Resolves security vulnerabilities and data integrity issues across
6 API endpoints without introducing race conditions or memory leaks.
Fixes build failures when SF credentials are not configured by gracefully
returning empty array in getGrantInitiativeItems(). This allows:
- CI/CD builds without credentials
- Local development builds
- Static site generation with fallback: 'blocking' to generate pages at runtime

The pages use ISR (Incremental Static Regeneration) with fallback: 'blocking',
so pages will be generated on first request when credentials are available.
@netlify
Copy link

netlify bot commented Nov 17, 2025

‼️ Deploy request for ecosystem-support rejected.

Name Link
🔨 Latest commit be2197b

@anuragchvn-blip
Copy link
Author

@pettinarip Would appreciate your review on this fix. This resolves build failures when Salesforce credentials aren't configured, which blocks CI/CD and local development builds.

@pettinarip
Copy link
Member

@anuragchvn-blip Hey, thanks for working on this! really appreciate the effort you put into improving the DX.

The PR got a bit stale with merge conflicts, and since we only needed the Salesforce credentials handling part right now, I went ahead and created #493 with a minimal fix for that specific issue.

Going to close this one, but thanks again for flagging the problem and taking a stab at it!

@pettinarip pettinarip closed this Jan 14, 2026
@anuragchvn-blip
Copy link
Author

Thanks for the update and for taking care of this! Totally understand the approach with the minimal fix. Appreciate the kind words and the quick follow-up — glad the issue is resolved. Happy to help again in the future! @pettinarip

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.

2 participants