Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Usage of tasklist in description deletes entire description #2580

Closed
markuman opened this issue Nov 18, 2020 · 14 comments · Fixed by #2584
Closed

Usage of tasklist in description deletes entire description #2580

markuman opened this issue Nov 18, 2020 · 14 comments · Fixed by #2584
Assignees

Comments

@markuman
Copy link

Describe the bug
When check off tasks of a markdown task list, the entire description will be deleted.

To Reproduce

  1. create a task list
- [ ] a
- [ ] b
- [ ] c
  1. check off one task after each other.
  2. you won't reach task "c", because after check off "b", everything is deleted.

It's also deleted in the database.

Expected behavior

description won't be deleted and the tasks list is just checked off.

Screenshots

deckbug2

Client details:

  • OS: linux
  • Browser firefox
  • Version 82.0.2
  • Device: desktop
  • Deck 1.2.1
  • Nextcloud 20.0.1.1
  • PHP 7.4.11
@LuCu11
Copy link

LuCu11 commented Nov 18, 2020

same here, is there an option to get the description back?

@markuman
Copy link
Author

Afaik no. It's also deleted in the database.

@markuman
Copy link
Author

The put request sets description: "". So it's related to the frontend/vuejs.

@markuman
Copy link
Author

https://github.com/nextcloud/deck/blob/master/src/components/card/Description.vue#L178

This is the function where the accident happen...

I'm a lousy js/vuejs hacker :D

@markuman
Copy link
Author

...but I like to hotfix it

@LuCu11
Copy link

LuCu11 commented Nov 18, 2020

luckily the description was from an old deck and I could use a DB backup

@markuman
Copy link
Author

In v1.1.2 it was this.copiedCard.description.replace ...now it replaces the content in place.

@markuman
Copy link
Author

When you're on mariadb >= 10.3, a workaround to prevent dataloss is, simple add system versioning to that table.

alter table oc_deck_cards add system versioning;

https://mariadb.com/kb/en/system-versioned-tables/

You can than query the history and recover lost data

select title, description, row_start, row_end from oc_deck_cards FOR SYSTEM_TIME BETWEEN (NOW() - INTERVAL 1 YEAR) AND NOW() where title like 'YOUR CARD TITLE%';

But that's not a permanent solution. Hopefully @juliushaertl find a fix for that fast.

@markuman
Copy link
Author

this.description is already empty when the function is triggered as far as I can see.

Bildschirmfoto vom 2020-11-18 21-52-30

@markuman
Copy link
Author

WOHOOOO I GOT IT

https://github.com/nextcloud/deck/blob/master/src/components/card/Description.vue#L183

must be this.card.description.replace

@juliusknorr
Copy link
Member

What a timing 😁 Thanks for looking into that already. I've pushed my fix (basically the same as yours) but included an additional commit to avoid issues in the modal in #2584

Reviews and testing are very welcome. There is also an app build available in the pull request artifacts that can be used for testing this without requiring to build the app yourself:

https://github.com/nextcloud/deck/pull/2584/checks?check_run_id=1420738455
https://github.com/nextcloud/deck/suites/1524832079/artifacts/26934287

@markuman
Copy link
Author

@juliushaertl works for me.
Thx!

@fridlmue
Copy link

fridlmue commented Nov 19, 2020

same here, is there an option to get the description back?

@LuCu11 For me it was always possible to recover the description from the history of the card. Hope this will work for you, too.
I hope the hotfix finds a fast way to a release 😉

@markuman
Copy link
Author

Oh well. Yeah, there is a timeline.

Screenshot_2020-11-19 Deck - Nextcloud(1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants