ankidroid / Anki-Android

AnkiDroid: Anki flashcards on Android. Your secret trick to achieve superhuman information retention.
GNU General Public License v3.0
8.4k stars 2.19k forks source link

[BUG]: "Not at top of the queue" error message when there is a deck is already open in App and the user open one through the Deck Picker Widget. #16956

Open xenonnn4w opened 2 weeks ago

xenonnn4w commented 2 weeks ago

Checked for duplicates?

Does it also happen in the desktop version?

What are the steps to reproduce this bug?

  1. open ankidroid
  2. open a deck A
  3. go back to android home
  4. from the widget open a deck b
  5. press back

error.webm

Expected behaviour

Closing the reviewer. Either going back to the deck picker or to android home.

Actual behaviour

You go back to deck A. But if you try to review, you get "Not at top of the queue" error message.

Debug info

AnkiDroid Version = 2.19alpha12-debug (862d98f07c76db50d4b56d8e166cb82b2fd6d2bb)

Backend Version = 0.1.40-anki24.06.3 (24.06.3 d678e39350a2d243242a69f4e22f5192b04398f2)

Android Version = 14 (SDK 34)

ProductFlavor = amazon

Manufacturer = Google

Model = sdk_gphone64_x86_64

Hardware = ranchu

Webview User Agent = Mozilla/5.0 (Linux; Android 14; sdk_gphone64_x86_64 Build/UE1A.230829.036.A2; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/113.0.5672.136 Mobile Safari/537.36

ACRA UUID = 6e047a69-354f-4375-9401-03fd88994cab

FSRS Enabled = false

Crash Reports Enabled = false

(Optional) Anything else you want to share?

No response

Research

welcome[bot] commented 2 weeks ago

Hello! 👋 Thanks for logging this issue. Please remember we are all volunteers here, so some patience may be required before we can get to the issue. Also remember that the fastest way to get resolution on an issue is to propose a change directly, https://github.com/ankidroid/Anki-Android/wiki/Contributing

Arthur-Milchior commented 2 weeks ago

Note that it already occurs when you have two shortcuts to two distinct decks

leobugeja commented 1 week ago

Hello, could I be assigned to this please.

Arthur-Milchior commented 1 week ago

@leobugeja You don't need to ask usually. If you have an idea how to fix it, or at least investigate, you can just state you'll work on it. There are not so many devs that we need to manage who does what

leobugeja commented 1 week ago

The problem appears to be that when using the shortcut to open deck review, that activity gets put ontop of the previous deck's review activity and when using the back button to close the top activity, updateCardAndRedraw does not get called (which inturn skips setting the current card) on the previous/old review activity and so we get the error not at top of queue.

@Arthur-Milchior, I can see two solutions:

Arthur-Milchior commented 1 week ago

Please close other reviewer activity. We are not expected to support multiple reviewer opened simultaneously