bartervg / barter.vg

Track and hold discussion on Barter.vg bugs, enhancements, and other issues
https://barter.vg
MIT License
20 stars 4 forks source link

Offer API does not use the passed `user_id` at all #266

Closed osmanyucel closed 3 years ago

osmanyucel commented 3 years ago

Describe the bug

While calling the offer API, as long as you pass offer_id correctly, it doesn't matter what user ID you pass.

Steps to reproduce the bug

  1. Go to https://barter.vg/u/a4/o/1168888/json/
  2. See that even though user_id passed is a4 the offer has nothing to do with that user.

Expected behavior

It should work as either one of the following options:

Screenshots

Screenshot from 2021-04-19 00-25-43

Additional context, device information (OS & Browser) if applicable

bartervg commented 3 years ago

Is this a bug or a feature? I won't change anything, at least until you've finished.

Revadike commented 3 years ago

It's unexpected behavior, but likely to be desired. Something to keep in mind for designing API v2.

@osmanyucel want to help document the current API? https://github.com/bartervg/barter.vg/wiki

Revadike commented 3 years ago

We could have a wiki page to list all current bugs and bad design issues, like this one. And consider them for API v2.

osmanyucel commented 3 years ago

It's unexpected behavior, but likely to be desired. Something to keep in mind for designing API v2.

@osmanyucel want to help document the current API? https://github.com/bartervg/barter.vg/wiki

We could have a wiki page to list all current bugs and bad design issues, like this one. And consider them for API v2.

I don't think I can find the time to work on the documentation, but I can list the design issues I see with the current API and share with you. I wasn't going to bring it up but if you have an API v2 on the horizon already, I can share my opinions about the API design.

Revadike commented 3 years ago

I'm not working on API v2. That would be done by @bartervg, but I don't think he started.

Also, I don't think this is the place to discuss all current API flaws, unless we convert this issue to it.

bartervg commented 3 years ago

https://barter.vg/u/a4/o/1168888/json/

{"offer_id":1168888,"success":false,"error":"this offer is not associated with the user"}

https://barter.vg/u/11dc/o/1168888/json/

{"offer_id":1168888,"success":true,"from_user_id":"11dc" ... }

Revadike commented 3 years ago

that may be a breaking change