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

Update files list after upload #3580

Merged
merged 3 commits into from
Sep 16, 2022
Merged

Conversation

Ashesh3
Copy link
Member

@Ashesh3 Ashesh3 commented Sep 14, 2022

Partially Fixes #3579

This PR changes when the file list is refreshed and makes it happen only after the upload is fully processed. This makes sure that the new file list contains information about the last upload action regardless of the success.

@Ashesh3 Ashesh3 requested a review from a team September 14, 2022 08:32
@Ashesh3 Ashesh3 requested a review from a team as a code owner September 14, 2022 08:32
@netlify
Copy link

netlify bot commented Sep 14, 2022

Deploy Preview for care-egov-staging ready!

Name Link
🔨 Latest commit 5b40d7e
🔍 Latest deploy log https://app.netlify.com/sites/care-egov-staging/deploys/6321fcecb7afc30009edd467
😎 Deploy Preview https://deploy-preview-3580--care-egov-staging.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@nihal467
Copy link
Member

nihal467 commented Sep 14, 2022

@Ashesh3
image

now the page is auto-refreshed, but the file name is still there under the box, can you fix that also

@nihal467 nihal467 added the question Further information is requested label Sep 14, 2022
@Ashesh3
Copy link
Member Author

Ashesh3 commented Sep 14, 2022

@Ashesh3 image

now the page is auto-refreshed, but the file name is still there under the box, can you fix that also

That should only happen if the file upload fails, I've added an error message when that happens.

image

@Ashesh3 Ashesh3 removed the question Further information is requested label Sep 14, 2022
@nihal467
Copy link
Member

@Ashesh3
image

my connection is more than 4 mbps and iam unable to upload the files

@Ashesh3
Copy link
Member Author

Ashesh3 commented Sep 14, 2022

@nihal467 Your internet connection isn't the issue here, it seems that the CORS misconfiguration Mathew mentioned was not resolved when you tried the upload (I had the same issue). The browser will report such errors are Network errors, since it's not able to contact the signing_url to upload the file due to this CORS restriction.

Edit: File uploads will not work for any domain other than care.coronasafe.in as per the new CORS configuration. Not sure if this was intentional or not, but with this, you will not be able to test file uploads on netlify deployments or localhost anymore.

Access-Control-Allow-Origin: https://care.coronasafe.in

@nihal467
Copy link
Member

test approved

@mathew-alex
Copy link
Contributor

@Ashesh3 @nihal467 - CORS policy updated to include deploy previews as well.

@khavinshankar khavinshankar added the question Further information is requested label Sep 14, 2022
@Ashesh3 Ashesh3 removed the question Further information is requested label Sep 14, 2022
@sonarcloud
Copy link

sonarcloud bot commented Sep 14, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.9% 0.9% Duplication

@Ashesh3
Copy link
Member Author

Ashesh3 commented Sep 14, 2022

It seems like file uploads are still failing for local and netlify deployments (develop branch) but working fine on staging.

@khavinshankar khavinshankar added the Cypress Test Pending The Cypress test are to be verified label Sep 15, 2022
@mathew-alex
Copy link
Contributor

It seems like file uploads are still failing for local and netlify deployments (develop branch) but working fine on staging.

Is it still failing?

@Ashesh3
Copy link
Member Author

Ashesh3 commented Sep 15, 2022

It seems like file uploads are still failing for local and netlify deployments (develop branch) but working fine on staging.

Is it still failing?

Unfortunately, yes.
image

Request URL: https://egov-s3-patient-data-10bedicu.s3.amazonaws.com/egov-s3-patient-data-10bedicu/CONSULTATION/7f6888e2-020d-42e1-b055-7bdf8fb65acb1663223780.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAULRENCOF6S7P2YT3%2F20220915%2Fap-south-1%2Fs3%2Faws4_request&X-Amz-Date=20220915T063620Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=61923f2ef2644bf90d228392c15a908e23767e1fd8391e830c6146be5a0ecd37
Request Method: OPTIONS

----

Status Code: 403 Forbidden
Remote Address: 52.219.160.207:443
Referrer Policy: strict-origin-when-cross-origin
Content-Type: application/xml
Date: Thu, 15 Sep 2022 06:36:20 GMT
Server: AmazonS3
Transfer-Encoding: chunked
x-amz-id-2: 7S+jEPZ8KLbOI/s5hfXCUtMCTcLyvJF3digbHtGEp1hkGgGK5dMH9wml9AnObQsyNUueNf2ubeE=
x-amz-request-id: 4CJRRKF1KZ3VD9PP
Accept: */*
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.9,hi;q=0.8
Access-Control-Request-Headers: content-disposition,content-type
Access-Control-Request-Method: PUT
Cache-Control: no-cache
Connection: keep-alive
Host: egov-s3-patient-data-10bedicu.s3.amazonaws.com
Origin: https://deploy-preview-3580--care-egov-staging.netlify.app
Pragma: no-cache
Referer: https://deploy-preview-3580--care-egov-staging.netlify.app/
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: cross-site
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36 Edg/105.0.1343.33

@mathew-alex
Copy link
Contributor

https://deploy-preview-3580--care-egov-staging.netlify.app

The deploy preview for staging is also added in CORS policy now. Should be working from now on.

@nihal467
Copy link
Member

@Ashesh3 can you check the cypress test

@Ashesh3
Copy link
Member Author

Ashesh3 commented Sep 16, 2022

@Ashesh3 can you check the cypress test

The Failing tests are totally unrelated to the PR and as Vignesh mentioned 2 days back, Cypress tests are broken in the current state and are to be ignored until they are fixed.

@khavinshankar khavinshankar merged commit 3514e14 into ohcnetwork:develop Sep 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Cypress Test Pending The Cypress test are to be verified tested
Projects
None yet
Development

Successfully merging this pull request may close these issues.

File Preview is not working properly in consultation page
4 participants