Skip to content

Add regression tests for BackupRestore culture-specific error handling#997

Draft
Copilot wants to merge 7 commits intomasterfrom
copilot/fix-backup-management-issue
Draft

Add regression tests for BackupRestore culture-specific error handling#997
Copilot wants to merge 7 commits intomasterfrom
copilot/fix-backup-management-issue

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 13, 2026

Adds test coverage for the BackupRestoreResponseMessageHandler and Accept-Language header that were added to handle culture-specific API version parsing failures on non-English systems.

Tests Added

ResponseMessageHandlers.spec.ts - 10 tests covering:

  • E_INVALIDARG + "Invalid API Version" detection and enhanced error messaging
  • Case-insensitive pattern matching (/Invalid API Version/i)
  • Fallback to default error handling for non-matching errors
  • Graceful handling of missing error structures

http-interceptor.spec.ts - 1 test:

  • Verification that Accept-Language: en-US header is added to all requests

Example Test

fit('should detect E_INVALIDARG with "Invalid API Version" and return enhanced error message', () => {
    const errorResponse = new HttpErrorResponse({
        error: {
            Error: {
                Code: 'E_INVALIDARG',
                Message: 'Invalid API Version'
            }
        },
        status: 400
    });

    const result = handler.getErrorMessage('Get backup Policies', errorResponse);

    expect(result).toContain('This error occurs on systems where the decimal separator is a comma');
    expect(result).toContain('culture-specific number parsing');
    expect(result).toContain('https://github.com/microsoft/service-fabric/issues/1551');
});

Total: 11 new tests, all passing (94 → 105 tests).

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • accounts.google.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=4037 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-77528942 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,16316563949654804416,7220601764031494894,262144 --disable-features=PaintHolding --variations-seed-version --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /opt/google/chrome/chrome /usr/bin/google-chrome --user-data-dir=/tmp/karma-77528942 --enable-automation --no-default-browser-check --no-first-run --disable-default-apps --disable-popup-blocking --disable-translate --disable-REDACTED-timer-throttling --disable-renderer-REDACTEDing --disable-device-discovery-notifications http://localhost:9876/?id=77528942 --headless --disable-gpu --disable-dev-shm-usage --remote-debugging-port=9222 (dns block)
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=4420 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-38850121 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,3258429198346532118,12388593229623909138,262144 --disable-features=PaintHolding --variations-seed-version --trace-process-track-uuid=3190708989122997041 ec.ts e-fabric-explorefit\|fdescribe grep (dns block)
  • android.clients.google.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=4037 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-77528942 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,16316563949654804416,7220601764031494894,262144 --disable-features=PaintHolding --variations-seed-version --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /opt/google/chrome/chrome /usr/bin/google-chrome --user-data-dir=/tmp/karma-77528942 --enable-automation --no-default-browser-check --no-first-run --disable-default-apps --disable-popup-blocking --disable-translate --disable-REDACTED-timer-throttling --disable-renderer-REDACTEDing --disable-device-discovery-notifications http://localhost:9876/?id=77528942 --headless --disable-gpu --disable-dev-shm-usage --remote-debugging-port=9222 (dns block)
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=4420 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-38850121 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,3258429198346532118,12388593229623909138,262144 --disable-features=PaintHolding --variations-seed-version --trace-process-track-uuid=3190708989122997041 ec.ts e-fabric-explorefit\|fdescribe grep (dns block)
  • clients2.google.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=4037 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-77528942 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,16316563949654804416,7220601764031494894,262144 --disable-features=PaintHolding --variations-seed-version --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /opt/google/chrome/chrome /usr/bin/google-chrome --user-data-dir=/tmp/karma-77528942 --enable-automation --no-default-browser-check --no-first-run --disable-default-apps --disable-popup-blocking --disable-translate --disable-REDACTED-timer-throttling --disable-renderer-REDACTEDing --disable-device-discovery-notifications http://localhost:9876/?id=77528942 --headless --disable-gpu --disable-dev-shm-usage --remote-debugging-port=9222 (dns block)
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=4420 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-38850121 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,3258429198346532118,12388593229623909138,262144 --disable-features=PaintHolding --variations-seed-version --trace-process-track-uuid=3190708989122997041 ec.ts e-fabric-explorefit\|fdescribe grep (dns block)
  • clientservices.googleapis.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=4037 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-77528942 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,16316563949654804416,7220601764031494894,262144 --disable-features=PaintHolding --variations-seed-version --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /opt/google/chrome/chrome /usr/bin/google-chrome --user-data-dir=/tmp/karma-77528942 --enable-automation --no-default-browser-check --no-first-run --disable-default-apps --disable-popup-blocking --disable-translate --disable-REDACTED-timer-throttling --disable-renderer-REDACTEDing --disable-device-discovery-notifications http://localhost:9876/?id=77528942 --headless --disable-gpu --disable-dev-shm-usage --remote-debugging-port=9222 (dns block)
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=4420 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-38850121 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,3258429198346532118,12388593229623909138,262144 --disable-features=PaintHolding --variations-seed-version --trace-process-track-uuid=3190708989122997041 ec.ts e-fabric-explorefit\|fdescribe grep (dns block)
  • optimizationguide-pa.googleapis.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=4037 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-77528942 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,16316563949654804416,7220601764031494894,262144 --disable-features=PaintHolding --variations-seed-version --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /opt/google/chrome/chrome /usr/bin/google-chrome --user-data-dir=/tmp/karma-77528942 --enable-automation --no-default-browser-check --no-first-run --disable-default-apps --disable-popup-blocking --disable-translate --disable-REDACTED-timer-throttling --disable-renderer-REDACTEDing --disable-device-discovery-notifications http://localhost:9876/?id=77528942 --headless --disable-gpu --disable-dev-shm-usage --remote-debugging-port=9222 (dns block)
  • redirector.gvt1.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=4037 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-77528942 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,16316563949654804416,7220601764031494894,262144 --disable-features=PaintHolding --variations-seed-version --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /opt/google/chrome/chrome /usr/bin/google-chrome --user-data-dir=/tmp/karma-77528942 --enable-automation --no-default-browser-check --no-first-run --disable-default-apps --disable-popup-blocking --disable-translate --disable-REDACTED-timer-throttling --disable-renderer-REDACTEDing --disable-device-discovery-notifications http://localhost:9876/?id=77528942 --headless --disable-gpu --disable-dev-shm-usage --remote-debugging-port=9222 (dns block)
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=4420 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-38850121 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,3258429198346532118,12388593229623909138,262144 --disable-features=PaintHolding --variations-seed-version --trace-process-track-uuid=3190708989122997041 ec.ts e-fabric-explorefit\|fdescribe grep (dns block)
  • safebrowsingohttpgateway.googleapis.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=4037 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-77528942 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,16316563949654804416,7220601764031494894,262144 --disable-features=PaintHolding --variations-seed-version --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /opt/google/chrome/chrome /usr/bin/google-chrome --user-data-dir=/tmp/karma-77528942 --enable-automation --no-default-browser-check --no-first-run --disable-default-apps --disable-popup-blocking --disable-translate --disable-REDACTED-timer-throttling --disable-renderer-REDACTEDing --disable-device-discovery-notifications http://localhost:9876/?id=77528942 --headless --disable-gpu --disable-dev-shm-usage --remote-debugging-port=9222 (dns block)
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=4420 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-38850121 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,3258429198346532118,12388593229623909138,262144 --disable-features=PaintHolding --variations-seed-version --trace-process-track-uuid=3190708989122997041 ec.ts e-fabric-explorefit\|fdescribe grep (dns block)
  • www.google.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=4037 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-77528942 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,16316563949654804416,7220601764031494894,262144 --disable-features=PaintHolding --variations-seed-version --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /opt/google/chrome/chrome /usr/bin/google-chrome --user-data-dir=/tmp/karma-77528942 --enable-automation --no-default-browser-check --no-first-run --disable-default-apps --disable-popup-blocking --disable-translate --disable-REDACTED-timer-throttling --disable-renderer-REDACTEDing --disable-device-discovery-notifications http://localhost:9876/?id=77528942 --headless --disable-gpu --disable-dev-shm-usage --remote-debugging-port=9222 (dns block)
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=4420 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-38850121 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,3258429198346532118,12388593229623909138,262144 --disable-features=PaintHolding --variations-seed-version --trace-process-track-uuid=3190708989122997041 ec.ts e-fabric-explorefit\|fdescribe grep (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Backup management from SF Explorer/PowerShell fails on some non-English systems due to incorrect API version parsing</issue_title>
<issue_description>microsoft/service-fabric#1551</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 5 commits February 13, 2026 22:42
- Add Accept-Language: en-US header to all HTTP requests to hint servers to use English locale
- Create BackupRestoreResponseMessageHandler to detect and handle "Invalid API Version" errors
- Apply the new error handler to all BackupRestore API calls
- Provide helpful error messages explaining the known culture/locale parsing issue

Co-authored-by: sridmad <7445097+sridmad@users.noreply.github.com>
Co-authored-by: sridmad <7445097+sridmad@users.noreply.github.com>
- Make error message more specific about affected locales (comma as decimal separator)
- Remove non-actionable suggestion about changing cluster locale
- Add direct link to GitHub issue for more information
- Make resolution steps clearer

Co-authored-by: sridmad <7445097+sridmad@users.noreply.github.com>
- Add comprehensive JSDoc to BackupRestoreResponseMessageHandler
- Extract error code and message pattern as constants for maintainability
- Use regex pattern matching instead of substring for more robust error detection
- Make error detection case-insensitive

Co-authored-by: sridmad <7445097+sridmad@users.noreply.github.com>
- Extract culture/locale error guidance as a constant for better maintainability
- Improve JSDoc to explain general handler purpose first
- Make error message construction more readable
- Address all code review feedback

Co-authored-by: sridmad <7445097+sridmad@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix backup management issue in non-English systems Handle culture-specific API version parsing failures in BackupRestoreService Feb 13, 2026
Copilot AI requested a review from sridmad February 13, 2026 22:55
- Add ResponseMessageHandlers.spec.ts with 10 tests for BackupRestoreResponseMessageHandler
  * Test detection of E_INVALIDARG with "Invalid API Version" message
  * Test enhanced error message with culture/locale guidance
  * Test case-insensitive message matching
  * Test fallback to default error handling for other errors
  * Test graceful handling of missing error details
  * Test inheritance from GetResponseMessageHandler
- Add Accept-Language header test to http-interceptor.spec.ts
- All 11 new tests pass (105 total tests, up from 94)

Co-authored-by: sridmad <7445097+sridmad@users.noreply.github.com>
Copilot AI changed the title Handle culture-specific API version parsing failures in BackupRestoreService Add regression tests for BackupRestore culture-specific error handling Feb 13, 2026
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.

Backup management from SF Explorer/PowerShell fails on some non-English systems due to incorrect API version parsing

2 participants