#[Solved] Node .updateDocument() appending `/` in request

9 messages · Page 1 of 1 (latest)

dusk light
#

Appwrite Node Version: ^13.0.1

I have come across this really strange behavior regarding an updateDocument call where is will append a forward slash to the end of the request resulting in a AppwriteException: The requested route was not found. error.

The frustrating part is it does not do this every time and I can't seem to track down the cause.

Appwrite Call

await DatabaseAPI.db.updateDocument(
  "games",
  "miniSolves",
  userSolve?.$id ?? "",
  {
    solved: solve.solved,
    time: solve.time,
    solve: solve.solve,
  }
);

Request
Request URL: https://blah/v1/databases/games/collections/miniSolves/documents/
Request Method: PATCH
Status Code: 404 Not Found

The proper request url should not include the trailing /

Appreciate any help in tracking down this issue ❤️

#

Node .updateDocument() appending / in request

vocal ridge
dusk light
#

Users have CRU rights, admins have CRUD rights (which is the account that is currently testing)

#

Let me check something real quick

#

I have a relationship attribute that was referencing a db where users didn't have C/U rights. Thought that might be the issue but it doesn't look like it

#

I've got to dip for some meetings but I may have some other things to test out on my end before bugging you some more now that I know it's probably not caused by the trailing slash (likely the effect of something I messed up as opposed to the cause)

prime cypress
dusk light
#

Alright had some time to further troubleshoot and it turns out I had an improperly handled asynchronous race condition that was causing the userSolve?.$id to not be set every time. Steven was on top of it.

The requested route was not found error threw me way off the trail when troubleshooting.

Appreciate the help, sorry for the busy work!