LemmyNet / jerboa

A native android app for Lemmy
GNU Affero General Public License v3.0
1.16k stars 166 forks source link

Clicking profile, sometimes show unkown error #1297

Open MV-GH opened 9 months ago

MV-GH commented 9 months ago

Jerboa Version

0.0.53

Android Version + Phone

N/A

Describe The Bug

click profile, shows unkown error, this is caused because shomehow it did the call with the anon account instead of the user account

To Reproduce

  1. click profile

In the case of a crash or when relevant include the logs

 FROM: https://lemmy.one/api/v3/user?person_id=-1&sort=New&saved_only=true
                                                                                                COMMON HEADERS
                                                                                                -> access-control-expose-headers: vary, content-encoding, content-type
                                                                                                -> alt-svc: h3=":443"; ma=86400
                                                                                                -> cache-control: private
                                                                                                -> cf-cache-status: DYNAMIC
                                                                                                -> cf-ray: 8368fb47fe8ab35a-PRG
                                                                                                -> content-type: application/json
                                                                                                -> date: Sat, 16 Dec 2023 18:27:38 GMT
                                                                                                -> server: cloudflare
                                                                                                -> strict-transport-security: max-age=31536000; includeSubDomains; preload
                                                                                                -> vary: accept-encoding, Origin, Access-Control-Request-Method, Access-Control-Request-Headers
                                                                                                BODY Content-Type: application/json
                                                                                                BODY START
                                                                                                {"error":"unknown","message":"Record not found"}
                                                                                                BODY END
dessalines commented 9 months ago

Looks like it has to do with an incorrect person_id=-1, which is an illegal record.

MV-GH commented 9 months ago

Yeah its because it did it used the AnonAccount instead which uses id = -1. To get anonAccount in personprofile it means that BottomNavActivity loaded this account instead of the actual userAccount. Seems to occur very rarely

MV-GH commented 5 months ago

Haven't had this experienced anymore but this seems very similar to #1424

Must be something weird going on with livedata