wekan / wekan

The Open Source kanban (built with Meteor). Keep variable/table/field names camelCase. For translations, only add Pull Request changes to wekan/i18n/en.i18n.json , other translations are done at https://app.transifex.com/wekan/wekan only.
https://wekan.github.io
MIT License
19.48k stars 2.83k forks source link

[BUG]: Moving cards makes them unavailable on other boards #5378

Open Dexus opened 5 months ago

Dexus commented 5 months ago

Issue

Server Setup Information

Problem description

Reproduction Steps

  1. Create a card in a board
  2. move this new card to another board
  3. try to open the card in other board - wait 5 sec crash of browser

Logs

don't show errors, because browser already crashed the window... after click on the broken card.

Dexus commented 3 months ago

additional ref: #5347

Dexus commented 3 months ago

@xet7

additional info:

moving a card to a other board, does not update the listId of the card, with the listId from the new Board. Or it does not update the boardId and keeps the old listId.

I'm not sure, what here is currently the right behavior that describes the problem. I can only see the Problem here, that the Card is corrupted.

MongoDB Script to identify the corrupted card:

const dbName = 'wekan';
const searchBoardID = '3DpHP9eomuGR8guoJ';

const col_boards = db.boards;
const col_lists = db.lists;
const col_cards = db.cards;
const col_users = db.users;
const co__avatars = db.avatars;

async function runSearch() {
    try {
        const cursorCards = col_cards.find({ "boardId": searchBoardID});
        const cursorLists = col_lists.find({ "boardId": searchBoardID}).toArray();

        await cursorCards.forEach(async (card) => {
            //printjson();
            const result = cursorLists.find((list) => list._id === card.listId);
            if (!result) {
              printjson({"cardID": card._id, "cardTitle": card.title, "boardId": card.boardId, "listId": card.listId, "RESULT": (result || "NOTFOUND")});
            }
        });
    } catch (err) {
        console.error('error while process:', err);
    }
}

runSearch();