HabitRPG / habitica

A habit tracker app which treats your goals like a Role Playing Game.
https://habitica.com
Other
11.83k stars 4.05k forks source link

Feeding pet to mount status and then rehatching/selecting incorrectly equips the pet #11072

Open shanaqui opened 5 years ago

shanaqui commented 5 years ago

_@Aerilita (3b724a41-48d3-4048-ae27-70b258cf5a72): "Here's something I ran into twice today with different pets, but it's not 100% recreatable.

  1. The pet selected next to the avatar is not the one I'm feeding.
  2. Fed Desert Wolf Cub into a mount. The icon displays an egg and a potion, because I have the ones required.
  3. Click the icon. The purple line runs across the top, but nothing changes in the inventory. However, there's a Desert Wolf Cub next to my avatar.
  4. Hard refresh doesn't change anything at this point.

Screenshot

I'll keep them this way for now in case it's visible in the database."_

Following those steps, I was able to replicate it exactly. In the Hall of Heroes, my current pet was listed as the pet I had fed until it became a mount, although that pet had a value of -1 (meaning previously fed to mount status).

Refreshing or syncing after the pet becomes a mount before trying to rehatch it prevents this issue.

So two issues here:

Alys commented 5 years ago

Confirmed Aerilita's report in the database:

"items.currentPet": "Wolf-Desert",
"items.pets.Wolf-Desert": -1,
"items.mounts.Wolf-Desert": true,
Alys commented 5 years ago

Another two reports from @Aerilita (3b724a41-48d3-4048-ae27-70b258cf5a72):

from 10 hours ago: "I've got that "fed the pet, tried to re-hatch, equipped the non-existent pet instead" issue happening again, with a Watery panda. The purple line ran just right at the last feeding, but I did have a 502 error in the middle (reloaded after it though...). I don't remember if there's any information needed about this bug, so I'll leave my pets in the current state for now."

from 8 hours ago: "And it happened again. I was really careful and synced before last feeding. I guess the current state is as useful as the previous one, only the pet is different..."

I can't find anything directly relevant in Loggly, although there are a lot of errors caused by a webhook so maybe that's slowing down the website's responsiveness, which could cause odd behaviour like this. I'm searching for more details about the webhook since we're likely to want to get the errors reduced even apart from this issue.

    "webhooks": [
        {
            "type": "globalActivity",
            "label": "",
            "enabled": true,
            "url": "https://habitica-monster-api.herokuapp.com/webhooks/habitica",
            "id": "7d30d757-0637-480c-a2f3-84189e61ff7a",
            "options": {},
            "createdAt": "2018-07-08T16:22:59.377Z",
            "updatedAt": "2019-06-26T20:53:50.998Z"
        }
    ]

{"fullError":{"name":"ParseError","host":"habitica-monster-api.herokuapp.com","hostname":"habitica-monster-api.herokuapp.com","method":"POST","path":"/webhooks/habitica","protocol":"https:","url":"https://habitica-monster-api.herokuapp.com/webhooks/habitica","gotOptions":{"path":"/webhooks/habitica","protocol":"https:","slashes":true,"auth":null,"host":"habitica-monster-api.herokuapp.com","port":null,"hostname":"habitica-monster-api.herokuapp.com","hash":null,"search":null,"query":null,"pathname":"/webhooks/habitica","href":"https://habitica-monster-api.herokuapp.com/webhooks/habitica","retry":{"methods":{},"statusCodes":{},"errorCodes":{}},"headers":{"user-agent":"got/9.6.0 (https://github.com/sindresorhus/got)","accept":"application/json","accept-encoding":"gzip, deflate","content-type":"application/json","content-length":12220},"hooks":{"beforeRequest":[],"beforeRedirect":[],"beforeRetry":[],"afterResponse":[],"beforeError":[],"init":[]},"decompress":true,"throwHttpErrors":true,"followRedirect":true,"stream":false,"form":false,"json":true,"cache":false,"useElectronNet":false,"body":"{"type":"scored","direction":"up","delta":0.5798096619915684,"task":{"repeat":{"m":true,"t":true,"w":true,"th":true,"f":true,"s":true,"su":true},"challenge":{},"group":{"approval":{"required":false,"approved":false,"requested":false},"assignedUsers":[],"sharedCompletion":"recurringCompletion"},"frequency":"daily","everyX":1,"streak":70,"daysOfMonth":[],"weeksOfMonth":[],"nextDue":["2019-06-26T20:00:00.000Z","2019-06-27T20:00:00.000Z","2019-06-28T20:00:00.000Z","2019-06-29T20:00:00.000Z","2019-06-30T20:00:00.000Z","2019-07-01T20:00:00.000Z"],"yesterDaily":true,"history":[...],"completed":true,"collapseChecklist":false,"type":"daily","notes":"","tags":["b885c32d-389f-462e-b1f8-b14d1f4ef3eb","8331253c-d202-4b18-97d7-900cd5babadf"],"value":45.61845234012969,"priority":1,"attribute":"str","startDate":"2018-07-11T20:00:00.000Z","checklist":[],"reminders":[],"createdAt":"2018-07-12T14:45:33.292Z","updatedAt":"2019-06-26T20:53:42.849Z","_id":"070baf38-cf34-4e33-b660-f19c1e1f94e0","text":" .... ","userId":"3b724a41-48d3-4048-ae27-70b258cf5a72","isDue":true,"id":"070baf38-cf34-4e33-b660-f19c1e1f94e0"},"user":{"_tmp":{"quest":{"progressDelta":0.8581182997475203,"collection":1},"streakBonus":2.2003776672580018,"drop":{"value":3,"key":"PandaCub","type":"Egg","dialog":"You've found a Panda Cub Egg!"}},"stats":{"buffs":{"str":0,"int":0,"per":85,"con":130,"stealth":0,"streaks":false,"snowball":false,"spookySparkles":false,"shinySeed":false,"seafoam":false},"training":{"int":0,"per":0,"str":0,"con":0},"hp":49.7,"mp":226.45905405405406,"exp":1085.674399511665,"gp":94.33192009991716,"lvl":72,"class":"healer","points":0,"str":0,"con":0,"int":36,"per":36,"toNextLevel":2160,"maxHealth":50,"maxMP":294},"_id":"3b724a41-48d3-4048-ae27-70b258cf5a72"},"webhookType":"taskActivity"}","method":"POST"},"statusCode":200,"statusMessage":"OK"},"timestamp":"2019-06-26T20:53:43.058Z","level":"error","message":"ParseError: Unexpected token O in JSON at position 0 in "https://habitica-monster-api.herokuapp.com/webhooks/habitica": \nOK...\n at EventEmitter.emitter.on (/usr/src/habitrpg/node_modules/got/source/as-promise.js:65:26)\n at process._tickCallback (internal/process/next_tick.js:68:7)"}

Alys commented 5 years ago

More information from Aerilita:

"Regarding 'equipping the nonexistent pet instead of re-hatching', I just tried to sync using the Habitica's sync button before re-hatching, and that doesn't help either. Naturally I understand that hard-reload would be a safe choice, just wanted to try since it was mentioned in the issue."

Alys commented 4 years ago

I've tested the bug described in the top post and it's still happening for me as written there.

We also have a new bug report from @Altariel (be317a32-c027-4032-bbd5-25ccb21eb912) of behaviour that's not quite the same but is similar enough that it probably requires the same fix:

"On the website, when I feed a pet and it turns into a mount, I can click it the hatching potion+egg to hatch a new pet, which stays unequipped as it was. But if I then feed a second pet and it turns into a mount, clicking the hatching potion+egg does nothing and I have to reload the page before I can click the hatching potion+egg to hatch a new pet, which then automatically equips itself. ... I'm using Avast Secure Browser"

Alys commented 4 years ago

@Altariel made this update today:

"I had enough food to raise two pets to mounts, but I stayed in Avast Secure Browser and paid special attention to what happened, and everything worked as intended. I know the issue I described before happened then and other times in the past, but I figured I should mention that it hadn't this time."

So it's clearly an intermittent bug (which is what I'd expect since we haven't seen other reports of it).

Alys commented 4 years ago

A related problem from @Acorn_Sprout (2a5618da-d8c4-4530-a943-3fa871ef4859): "Some of the time after I've tamed a pet I can click on the resultant egg+potion to get the next pet. Other times (at this moment, with my Skeleton Pig) when I click on the square the page just [syncs] but does not create the pet."

Alys commented 3 years ago

Another report of this from @Alexa_Trebek (0e03930c-f4d3-4d21-9791-583de390043b):

"... I should report that I don't actually "own" the ruby tiger pet that I currently have equipped. I just leveled that pet up to a mount and had accidentally double clicked the faded out pet form as I started to scroll up my screen. The pet form still equipped to my avatar, and even when I refreshed the page, the pet stayed equipped even though I shouldn't have it."

I confirmed that they had the pet equipped even though they don't own it.

megansearles commented 2 years ago

Hi, can I take this issue?

CuriousMagpie commented 2 years ago

@megansearles You sure can and with our thanks!

megansearles commented 2 years ago

Have there been any more reports of issues of this type since 2020? I haven't been able to reproduce any of these yet (though I know that doesn't mean it's not still an issue), so I thought it might be useful if it were possible to see a more recent example too

Nakonana commented 2 years ago

It is still happening for me on Win 10 Firefox 97.0.1 (64-Bit). But I don't see any errors in the console. I just replicated it a few minutes ago with my Thunderstorm Cactus and Thunderstorm Panda, but the issue didn't happen with my Thunderstorm Fox 🙃. Possible considerations for replication:

For the cactus, I clicked to rehatch immediately, without waiting for the purple bar at the top to fully load/complete the feeding process before rehatching. This unequipped my Glass Dragon and equipped the cactus.

(I think, I did a refresh between those two? I definitely opened a new Habitica Inventory/Items tab to check if I have more magic potions to test for the bug another time because of the lack of console errors.)

For the panda, I waited for the purple bar to load completely after feeding the panda/before attempting to rehatch. This unequipped the Glass Dragon, but did not equip the panda.

Equipped my Glass Dragon back without refreshing or opening any new Habitica tabs. Then went for another replication attempt with the Thunderstorm Fox. I didn't wait for the purple bar to load, like with the cactus. The fox rehatched and my Glass Dragon is still equipped.

Edit: Closed the Stable tab, went to the Inventory tab and accessed the stable there. I saw an unfed Thunderstorm Panda pet and refreshed. Now it was a rehatched panda, but the Thunderstorm Cactus was not rehatched (yet, it got equipped during my testing??? 🙃) . At least the fox appears to be well-fed and rehatched.

megansearles commented 2 years ago

@Nakonana Thank you so much!! For each of these examples, did you own the necessary eggs and hatching potions? Also, do you have the preference set to not show popups when hatching or raising a pet to a mount?

Nakonana commented 2 years ago

@megansearles you're welcome 👍.

Regarding your questions:

SabreCat commented 2 years ago

@megansearles are you still working on this?

megansearles commented 2 years ago

Hi @SabreCat ! Yes, sorry for the period of inactivity. Just getting settled in after moving cross country, but now I have my computer stuff set back up!

megansearles commented 2 years ago

Hi again @SabreCat, I actually should probably find a different bug to work on. I've spent many hours on this one, but haven't been able to reproduce it yet

CuriousMagpie commented 2 years ago

Thanks for letting us know, @megansearles! I've removed you and re-tagged this as help wanted. Let us know if you find a different issue!