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

ALS-7014: Implement signed URL functionality for data exports #119

Merged
merged 9 commits into from
Sep 6, 2024

Conversation

ramari16
Copy link
Contributor

No description provided.

@ramari16 ramari16 added the enhancement New feature or request label Aug 30, 2024
Comment on lines 247 to 254
// This happens sometimes when users immediately request the status for a query
// before it can be initialized. We wait a bit and try again before throwing an
// error.
try {
Thread.sleep(100);
} catch (InterruptedException e) {
return ResponseEntity.status(500).build();
}
Copy link
Member

Choose a reason for hiding this comment

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

What does waiting do? Are you debouncing a button on the backend?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is boilerplate code copied from the /result endpoint. But true, it should not be needed, no one should call this endpoint until the status returns SUCCESS which would mean the query exists

.contentType(MediaType.APPLICATION_JSON)
.body(new SignedUrlResponse(presignedGetUrl));
} else {
return ResponseEntity.status(400).body("Status : " + result.getStatus().name());
Copy link
Member

Choose a reason for hiding this comment

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

Is 400 a fair response code for pending statuses? Maybe 202?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I think it is appropriate. Or at least consistent with the current workflow of the /result endpoint. The front end polls /status until it is SUCCESS, then calls this endpoint for a signed url, or /result for the document itself

@ramari16 ramari16 merged commit acf1147 into genomic-v2 Sep 6, 2024
3 checks passed
@ramari16 ramari16 deleted the ALS-7014 branch September 6, 2024 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants