Anki-Android icon indicating copy to clipboard operation
Anki-Android copied to clipboard

[BUG]: note edits flip cards to 'question' side

Open Arthur-Milchior opened this issue 1 year ago • 9 comments

Checked for duplicates?

  • [X] This issue is not a duplicate

What are the steps to reproduce this bug?

Open the reviewer, tap on "answer".

  • [x] Tap on "mark"
  • [ ] Edit Tags (https://github.com/ankidroid/Anki-Android/pull/14875)
  • [ ] Edit Note

Expected behaviour

Answer updated

Actual behaviour

It shows the question again

Debug info

Running on df10031dac7bcdbb9640d51bd9b9040de87ed315

(Optional) Anything else you want to share?

No response

Research

  • [X] I am reporting a bug specific to AnkiDroid (Android app)
  • [X] I have checked the manual and the FAQ and could not find a solution to my issue
  • [X] (Optional) I have confirmed the issue is not resolved in the latest alpha release (instructions)

Arthur-Milchior avatar Nov 03 '23 23:11 Arthur-Milchior

I think that the Desktop behaves similarly (not verified).

user1823 avatar Nov 04 '23 01:11 user1823

(or anything that edit the note)

Changing flags doesn't create the issue

BrayanDSO avatar Nov 04 '23 07:11 BrayanDSO

@user1823 Nice to meet you, but I'd invite you to verify if you have doubt. I did, (admittedly, I didn't write it up, and I'm sorry for that), marking a note on current version of anki, or even editing its content, keep you in answer side if you are in answer side.

@BrayanDSO I beg your pardon, I should have emphasized the part "editing the note". The flag is applied to the card only. I did test it too and noticed it didn't create the bug.

Arthur-Milchior avatar Nov 04 '23 19:11 Arthur-Milchior

I just tested this on the Desktop version. @Arthur-Milchior, you are right; this bug doesn't exist there.

When I made the above comment, I was not on my desktop and so, I couldn't verify. I thought that it can be easily verified by anyone who was on desktop. But sorry for the inconvenience caused.

user1823 avatar Nov 05 '23 04:11 user1823

This should be a good one for you to get up to speed with the undo infrastructure Arthur. The way to solve this is:

  • move or copy toggleMark() into the reviewer
  • pass the reviewer into the undoableOp() inside it, which will prevent the default refresh behavior
  • make toggleMark() update the UI as necessary

dae avatar Nov 05 '23 04:11 dae

@BrayanDSO changing flags doesn't trigger this, because they haven't been made undoable yet

dae avatar Nov 05 '23 04:11 dae

Editing tags again unflips the card in 2.17 beta 5.

Recently, I have noticed it multiple times that the fix for one issue causes a previously solved issue to reappear. So, after 2.17 is out, I think that it would help to work on adding more automated tests.

user1823 avatar Feb 20 '24 13:02 user1823

Recently, I have noticed it multiple times that the fix for one issue causes a previously solved issue to reappear. So, after 2.17 is out, I think that it would help to work on adding more automated tests.

Indeed - worth noting that in this specific area I think there were some tests added just recently. Somewhat surprising they didn't catch this regression

mikehardy avatar Feb 20 '24 16:02 mikehardy

Hello 👋, this issue has been opened for more than 3 months with no activity on it. If the issue is still here, please keep in mind that we need community support and help to fix it! Just comment something like still searching for solutions and if you found one, please open a pull request! You have 7 days until this gets closed automatically

github-actions[bot] avatar Aug 12 '24 00:08 github-actions[bot]