Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance timeout upload #126

Merged
merged 11 commits into from
Sep 10, 2024
Merged

Enhance timeout upload #126

merged 11 commits into from
Sep 10, 2024

Conversation

FriggaHel
Copy link
Contributor

Add explicit message when uploads reaches timeout.

Issue : IRIS-1234

Example in storybook context:

  ● Example/Page › Logged In › play-test

    Uploading snapshot reached timeout.
    Please check that you have connectivity and are able to do HTTP PUT requests.
    URL: https://storage.googleapis.com/sauce-iris-prod-us-west4-ybyc/orgs/[orgId]/e4ea0fd1-21ba-4397-ac45-202a41f094f9.png?X-Goog-Algorithm=GOOG4-RSA-SHA256&X-Goog-Credential=sauce-svc-iris-bucket-prod%40sauce-production-p-i0l6.iam.gserviceaccount.com%2F20240910%2Fauto%2Fstorage%2Fgoog4_request&X-Goog-Date=20240910T120018Z&X-Goog-Expires=900&X-Goog-SignedHeaders=content-type%3Bhost&response-content-disposition=attachment&X-Goog-Signature=[SIG]
    Note: This URL is valid only for a couple of minutes

      16864 |       if (ex?.name === "AbortError") {
      16865 |         console.error();
    > 16866 |         throw new Error(`Uploading snapshot reached timeout.
            |               ^
      16867 | Please check that you have connectivity and are able to do HTTP PUT requests.
      16868 | URL: ${uploadUrl}
      16869 | Note: This URL is valid only for a couple of minutes`);

      at uploadToUrl (../visual-sdks/visual-js/visual/build/index.cjs:16866:15)
      at Object.uploadSnapshot (../visual-sdks/visual-js/visual/build/index.cjs:16888:5)
      at postVisit (storybook/node_modules/@saucelabs/visual-storybook/build/index.cjs:332:20)
      at testFn (../../../../../private/var/folders/p0/6kkfxbnd1lz84fg_ck1jnmfc0000gn/T/29d28a7bd3b1e4861e377e4b1f87919f/example-page.test.js:65:11)
      at Object.<anonymous> (../../../../../private/var/folders/p0/6kkfxbnd1lz84fg_ck1jnmfc0000gn/T/29d28a7bd3b1e4861e377e4b1f87919f/example-page.test.js:79:9)

Test Suites: 18 failed, 18 of 3 total```

## Description
Adds a controlled timeout  (default: 10s) that will be used to communicate with the user when upload is taking too much time.

## Types of Changes
_What types of changes does your code introduce? Keep the ones that apply:_

- New feature (non-breaking change which adds functionality)
_List of tasks the reviewer must do to review the PR_
- [ ] Tests
- [ ] Documentation
- [ ] CHANGELOG

## Deployment Notes
These should highlight any db migrations, feature toggles, etc.

@FriggaHel FriggaHel force-pushed the IRIS-1234-enhance-timeout-upload branch from 1ad27d8 to 55b5650 Compare September 10, 2024 15:28
visual-js/visual/src/common/api.ts Outdated Show resolved Hide resolved
visual-js/visual/src/common/api.ts Outdated Show resolved Hide resolved
@FriggaHel FriggaHel merged commit 1399b9c into main Sep 10, 2024
1 check passed
@FriggaHel FriggaHel deleted the IRIS-1234-enhance-timeout-upload branch September 10, 2024 16:29
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