Conversation
Adding 2 new checkpoints for breaking down the solution to having a "user not found" page, step by step.
Adding validation logic to `User.jsx`
|
@astrosnat if we can get #573 done, then I can test this on my local MacOS. |
|
OK, tested on localhost.
So basically, you created a frontend page it seems which will display when UserNotFound. A couple things:
socialpredict/backend/server/server.go Line 137 in 0bcb6ca Which then goes to GetPublicUserResponse: Which then just does a query to the database with this function: This is returning the type PublicUser, which is designed to only feed out public information about a user, nothing private, which is defined in the user model here: socialpredict/backend/models/user.go Line 16 in 0bcb6ca So maybe we could do something like this:
Then the handler; The idea here is to align with our new simple logging convention. https://github.com/openpredictionmarkets/socialpredict/blob/main/backend/logger/simplelogging.go Now how to deal with this on the front end I'm not sure. I know we already have a not found page. https://github.com/openpredictionmarkets/socialpredict/tree/main/frontend/src/pages/notfound And here is our user page: https://github.com/openpredictionmarkets/socialpredict/blob/main/frontend/src/pages/user/User.jsx So ideally, I would think there would be a way to redirect from the user page to the 404 page with some additional information/specific error contained. However I don't have time to dig into that at the moment, just a thought. |
|
Update: Still going to fix 569, but this comes after the backend refactor |
|
Can we close this since the fix is more complicated and since we're refactoring the backend toward a services architecture? |

Aimed at fixing issue 569 - on development I can now make users get this page
Still needs to be tested on localhost and staging.
Not a complete fix as it doesn't yet handle an edge case where an API can return empty user data.