HabitRPG/habitica

Challenge tag is not always created when a player joins a challenge

Open

#10,689 创建于 2018年9月16日

在 GitHub 查看
 (8 评论) (0 反应) (0 负责人)JavaScript (10,775 star) (3,912 fork)batch import
help wantedmongodb transactionspriority: mediumsection: Challenges

描述

In the Report a Bug guild, donotgogentle🌼🌷🌻 (65be576c-c412-41c7-a31f-94994c8c4fc6) says:

When I join Challenges, sometimes the associated tag does not show up, though the tasks appear. Example of one I just joined: https://habitica.com/challenges/2350bb37-29f8-42dd-9a43-c3cc9e9d1939

I've confirmed that they are in that challenge and don't have the tag. They joined it on Sep 11, 11:45:04 pm UTC. There's no errors recorded in Loggly around that time, although there are quite a few "Your session is outdated" and "Notification not found" errors in the surrounding days, implying that the account is often in a state where failures might be occurring from multiple simultaneous actions or from the account being updated in two or more platforms / tools at the same time.

I don't recall seeing other reports of this so I'm marking it minor priority and needs investigation for now.

I imagine this problem would stop happening once we're using database transactions.


With PR #12335 the Habitica codebase has been updated to support MongoDB 4.2 and transactions making it possible to fix this issue.

Transactions allow operations on multiple documents to be executed ensuring that either all of them are executed correctly or none, making it possible to fix this issue.

An example on using transactions can be found at https://mongoosejs.com/docs/transactions.html while more info at https://docs.mongodb.com/manual/core/transactions/. If you want to work on this issue and have any question please leave a comment!

贡献者指南