You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
Copy file name to clipboardExpand all lines: CHANGELOG.md
+27Lines changed: 27 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,32 @@
1
1
# CHANGELOG
2
2
3
+
## v5.2.0
4
+
5
+
### API Versions
6
+
7
+
| API Name | API Version |
8
+
|----------|-------------|
9
+
| shopper-login | 1.46.0 |
10
+
| shopper-baskets | 1.11.0 |
11
+
| shopper-baskets | 2.5.1 |
12
+
| shopper-configurations | 1.2.0 |
13
+
| shopper-consents | 1.1.4 |
14
+
| shopper-context | 1.1.3 |
15
+
| shopper-customers | 1.6.1 |
16
+
| shopper-experience | 1.2.1 |
17
+
| shopper-gift-certificates | 1.2.0 |
18
+
| shopper-orders | 1.12.1 |
19
+
| shopper-payments | 1.4.0 |
20
+
| shopper-products | 1.3.0 |
21
+
| shopper-promotions | 1.2.0 |
22
+
| shopper-search | 1.8.0 |
23
+
| shopper-seo | 1.0.17 |
24
+
| shopper-stores | 1.2.0 |
25
+
26
+
### Enhancements
27
+
28
+
- Add automatic maintenance mode detection via `throwOnMaintenanceHeader` client config option. When enabled, the SDK throws `MaintenanceError` (503) if the server responds with `sfdc_maintenance` header set to `'system'` or `'site'`. This feature is opt-in and fully backward compatible.
Copy file name to clipboardExpand all lines: README.md
+34Lines changed: 34 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -138,6 +138,40 @@ try {
138
138
}
139
139
```
140
140
141
+
#### `throwOnMaintenanceHeader`
142
+
143
+
When `true`, the SDK automatically detects maintenance mode by checking the `sfdc_maintenance` response header. If the header value is `'system'` or `'site'`, the SDK throws a `MaintenanceError` with status 503. This is useful for handling scheduled maintenance windows and displaying appropriate messaging to users. By default, this flag is `false` for backwards compatibility.
0 commit comments