FNNDSC / FNNDSC/cni-store-proxy

Wait for successful CUBE registration+upload before responding

Open
#1 0 comments 0 reactions 0 assignees View on GitHub
wontfix
Dominant language
JavaScript
Stars
0
Forks
1
PR merge metrics
No merged PRs in 30d

Description

https://github.com/FNNDSC/cni-store-proxy/blob/c897c838e2714b0c8bd8c70755bcbab7fbcd2480/src/store.js#L71-L74

An alternative approach would be to have passed `proxy.web(req, res, { selfHandleResponse: true })` and do something here like

```javascript
try {
await this.registerAndRun(body);
res.end();
catch (e) {
res.status(500).end();
}
```

i.e., wait until after feed is successfully created in CUBE before responding, so that we guarantee that feed exists in CUBE after the response.

However this cannot be implemented until new features are added to `node-http-proxy`

- https://github.com/http-party/node-http-proxy/issues/1451
- https://github.com/http-party/node-http-proxy/pull/1461

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with src/store.js#L71-L74 and review the linked node-http-proxy issue 1451 and pull request 1461. Confirm the required proxy support before changing the response flow. Done means the response is sent only after successful CUBE registration and upload, with the shown 500 response on failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
express, javascript
Domain
api, backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.