-
Notifications
You must be signed in to change notification settings - Fork 116
Closed
Labels
Description
The current move_thread_to_category implementation is not updating thread.category_id, which is causing multiple issues when moving a thread between categories.
For example, let's assume we have two categories: 1 and 2, and a single thread in category 1
- We move the thread from category
1to category2. This works as expected so far, thethreadByIdmap is updated and thenum_direct_threadscounter for each category is correct (0and1respectively) - We move the thread from category
2back to category1. Becausethread.category_idis still1after the first step, the thread is not actually removed from category2and ends up duplicated (appears in both categories). Furthermore, thenum_direct_threadsof category1is first decremented and then incremented, causing it to remain at0. - We move the thread from category
1to category2again. The thread is now removed from category1and thenum_direct_threadsin category1is decremented again, causing the counter to overflow to4294967295. Thenum_direct_threadsis incremented causing it to become2, which is also invalid.
┆Issue is synchronized with this Asana task by Unito