Skip to content
This repository has been archived by the owner on Mar 8, 2024. It is now read-only.

404 Error when fetch an user after deleting an address #624

Open
jruffer opened this issue Jul 29, 2020 · 1 comment
Open

404 Error when fetch an user after deleting an address #624

jruffer opened this issue Jul 29, 2020 · 1 comment
Assignees
Labels
Bug Something isn't working

Comments

@jruffer
Copy link

jruffer commented Jul 29, 2020

Expected Behavior

Actual Behavior

Context

Potential Solution

Steps to Reproduce

#!/bin/bash
API_URL="http://localhost:8081"

Create foo$127.0.0.1 user with 1 address

curl --location --request POST "$API_URL/users"
--header 'PayID-API-Version: 2020-06-18'
--header 'Authorization: foo'
--header 'Content-Type: application/json'
--data-raw '{
"payId": "foo$127.0.0.1",
"addresses": [
{
"paymentNetwork": "XRPL",
"environment": "TESTNET",
"details": {
"address": "rDk7FQvkQxQQNGTtfM2Fr66s7Nm3k87vdS",
"tag": "123"
}
}
]
}'
echo
echo

Fetch the user to see what it looks like

curl --location --request GET "$API_URL/users/foo$127.0.0.1"
--header 'PayID-API-Version: 2020-06-18'
--header 'Authorization: foo'
--header 'Content-Type: application/json'
echo
echo

Updating the user and removing addresses in the process

curl --location --request PUT "$API_URL/users/foo$127.0.0.1"
--header 'PayID-API-Version: 2020-06-18'
--header 'Authorization: foo'
--header 'Content-Type: application/json'
--data-raw '{
"payId": "foo$127.0.0.1",
"addresses": [
]
}'
echo
echo

Fetch the user to see what it looks like

curl --location --request GET "$API_URL/users/foo$127.0.0.1"
--header 'PayID-API-Version: 2020-06-18'
--header 'Authorization: foo'
--header 'Content-Type: application/json'
echo
echo

returns error:

{"statusCode":404,"error":"Not Found","message":"No information could be found for the PayID foo$127.0.0.1."}

User not found, so I assume I can create it again

curl --location --request POST "$API_URL/users"
--header 'PayID-API-Version: 2020-06-18'
--header 'Authorization: foo'
--header 'Content-Type: application/json'
--data-raw '{
"payId": "foo$127.0.0.1",
"addresses": [
{
"paymentNetwork": "XRPL",
"environment": "TESTNET",
"details": {
"address": "rDk7FQvkQxQQNGTtfM2Fr66s7Nm3k87vdS",
"tag": "123"
}
}
]
}'
echo
echo

returns error:

{"statusCode":409,"error":"Conflict","message":"There already exists a user with the provided PayID"}

Environment

  • Node version:
  • NPM version:
  • Operating System and version:
  • PayID server version:
  • PayID Version header (if applicable):

Screenshots

If applicable, add screenshots to help explain your problem.

Bonus

Are you willing to submit a pull request to fix this bug?

@0xCLARITY 0xCLARITY self-assigned this Jul 29, 2020
@0xCLARITY 0xCLARITY added the Bug Something isn't working label Jul 29, 2020
@snub-fighter
Copy link

@intelliot has any work begun on this ? We just hit it as well.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants