inaturalist / iNaturalistAndroid

Android app for iNaturalist.org
https://market.android.com/details?id=org.inaturalist.android
MIT License
165 stars 57 forks source link

You can accidentally erase your profile text #1220

Open tiwane opened 2 years ago

tiwane commented 2 years ago

A user running version 1.27.7 - 549 erased their profile text when editing it in the Android app. I can replicate what I think they did in 1.27.8 - 550

  1. Edit profile by adding some text.
  2. Tap on checkmark in upper right-hand corner to save changes.
  3. Check website - profile has been updated.
  4. Go to Edit Profile again in app - all profile text is gone.
  5. Tap on checkmark (which is what I think some people do, but i can't confirm).
  6. Check website - profile text deleted.

So the issue is that somehow the text appears to be deleted in the app, even though it's not, which I think causes people to accidentally save their profile sans text.

tiwane commented 2 years ago

Screen recording and log files here: https://inaturalist.slack.com/archives/G041A2Z1W/p1661892936177359

budowski commented 2 years ago

@kueda / @pleary - from what I can tell, the endpoint PUT https://api.inaturalist.org/v1/users/myusername changed its response:

  1. No longer returning an icon in user_icon_url, but rather in icon_url.
  2. No longer returning description (user bio) at all.
  3. No longer returning email at all.

So we have two options here - either update the API to return these, or update the app to user icon_url and for description/email - not use these at all. What do you think?

pleary commented 2 years ago

I don't think the response for PUT /v1/users/:login ever returned these attributes and I don't think the response has changed recently. The GET /v1/users/me endpoint for authenticated users returns email, description, and icon as well as icon_url (different sizes). The old rails API endpoint returns a user_icon_url, which may be the response you had been working against? Since things haven't changed on the API end recently, I wonder if something has changed on the Android end recently, like for example you were using the old Rails endpoint and switched to the v1 API expecting it had the same response but it didn't. Let me know if we still need to add new attributes to v1 API endpoints, or if you can get these from GET /v1/users/me

budowski commented 2 years ago

@pleary - you're right! I used git blame and looked at the history for that specific piece of code: Seems like we switched from the old rails host (https://www.inaturalist.org) to the new host (https://api.inaturalist.org/v1/) for this endpoint - but this was 17 months ago, so interestingly enough it's been around for a while (@tiwane). I'll update the app in this case, then