NIP-96 uploads fail even when successful
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 65/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- typescript
- Domain
- api
Research direction
Start at Nip96.upload, where the response status is checked after posting to the upload URL. Review the server response handling and confirm that a successful 202 Accepted upload is treated as successful rather than reported as an error. Done means uploads returning the documented successful status no longer throw.
Written by the indexing model from the issue text.
Description
Uploading files with Nip96.upload fail because of too strict status code handling. (tested with different servers)
The error:
Error uploading file: Error: Failed to upload file to https://files.sovbit.host/api/v2/media
at Nip96.upload (index.mjs:7954:13)
at async Object.onUpload (Editor.js:122:56)
The answer of the server:
Request URL: https://files.sovbit.host/api/v2/media
Request Method: POST
Status Code: 202 Accepted
The code that checks for the status code:
if (res.status !== 200)
throw new Error(`Failed to upload file to ${url}`);
- Dominant language
- TypeScript
- Stars
- 453
- Forks
- 126
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from nostr-dev-kit/ndk
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
nostr-dev-kit/ndk#399 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
nostr-dev-kit/ndk#398 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 86/100
nostr-dev-kit/ndk#394 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
nostr-dev-kit/ndk#389 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
nostr-dev-kit/ndk#255 ·
All issues in nostr-dev-kit/ndk
Similar issues
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 91/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 95/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100