Skip to content

[feat] W@22204269 Release v5.2.0 - Add maintenance mode detection#282

Open
priandsf wants to merge 2 commits intomainfrom
priand/W_22204269_Maintenance_mode
Open

[feat] W@22204269 Release v5.2.0 - Add maintenance mode detection#282
priandsf wants to merge 2 commits intomainfrom
priand/W_22204269_Maintenance_mode

Conversation

@priandsf
Copy link
Copy Markdown

Add automatic maintenance mode detection via throwOnMaintenanceHeader option.

When enabled, the SDK detects maintenance windows by checking the sfdc_maintenance response header and throws MaintenanceError (503) when the value is 'system' or 'site'.

Key features:

  • Opt-in via client configuration (backward compatible)
  • New MaintenanceError class with detailed error information
  • Works with all API endpoints
  • Takes precedence over other error handling
  • Comprehensive test coverage (100%)

Changes:

  • Add MaintenanceError class and tests
  • Add throwOnMaintenanceHeader to ClientConfig
  • Add header check in doFetch()
  • Export MaintenanceError from helpers
  • Update README with usage documentation
  • Update CHANGELOG for v5.2.0
  • Bump version to 5.2.0

@priandsf priandsf requested a review from a team as a code owner April 23, 2026 21:50
this.proxy = config.proxy;
}
this.throwOnBadResponse = !!config.throwOnBadResponse;
this.throwOnMaintenanceHeader = !!config.throwOnMaintenanceHeader;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just use throwOnBadResponse flag instead of using new flag. when throwOnBadResponse=true, the current code already throws error. We can throw MaintenanceError in this case

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is actually on purpose to maintain backward compatibility. One may just enable this option while not having exceptions for the other errors.

Copy link
Copy Markdown
Contributor

@unandyala unandyala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

overall the changes look good to me. I just left one comment

Add automatic maintenance mode detection via throwOnMaintenanceHeader option.

When enabled, the SDK detects maintenance windows by checking the
sfdc_maintenance response header and throws MaintenanceError (503)
when the value is 'system' or 'site'.

Key features:
- Opt-in via client configuration (backward compatible)
- New MaintenanceError class with detailed error information
- Works with all API endpoints
- Takes precedence over other error handling
- Comprehensive test coverage (100%)

Changes:
- Add MaintenanceError class and tests
- Add throwOnMaintenanceHeader to ClientConfig
- Add header check in doFetch()
- Export MaintenanceError from helpers
- Update README with usage documentation
- Update CHANGELOG for v5.2.0
- Bump version to 5.2.0
@priandsf priandsf force-pushed the priand/W_22204269_Maintenance_mode branch from d4f528f to af1f58d Compare April 24, 2026 20:42
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