“Order added” in filtered deck yields random and non-deterministic order

Hi, folks!

I had to reinstall AnkiDroid and I’m now on 2.17.6 (anki 23.12.1 / 1a1d4d54). I’ve been using AnkiDroid for five years or so on an almost daily basis. Today, I was forced to reinstall AnkiDroid and replay a backup (which luckily was complete). My normal usage pattern is: Review first, new cards (if existing) later. In the review, I like to learn my cards in creation order. For this purpose, I use a filtered deck (usually called “all”) that is filtered on “is:due” and ordered by “Ordered added”. Since my reinstall, this yields a random order! I cannot explain why, but whenever I rebuild the deck, the first card changes. It is never even close to being the oldest card (i. e., the one having the youngest creation date). My mapping between cards and notes is one-to-one, so there’s no complication from this side.

I searched the forum and the documentation thoroughly and couldn’t find any explanation. In my memory, setting up the filtered deck was quite simple. Does anybody know what to do about this?

Warmest regards
A

Does this happen on both Droid and Desktop?

It’s possible that with this update you’ve moved from the v2 to v3 scheduler. Have you tried deleting (not just emptying) the filtered deck and creating it fresh? It could also help to run a Check Database in between deleting and recreating it.

I haven’t tried on Desktop yet, but another phone with the same version of AnkiDroid (but an older operating system) gives correct results. I’m very much confused and don’t know what to say. Maybe throw the phone out? :face_with_raised_eyebrow: Thank you for your help!

A

I feel like there are at least a couple more things to tryin before throwing the phone out … like the ones I mentioned above. :wink:

You’re right as gold! Since I’ve been updating my apps semi-regularly, the version of AnkiDroid I’ve been using has only had the v3 scheduler for quite some time. A few days ago, AnkiDroid was working quite happily.

On Desktop, I get the error messages “use v2 scheduler”, but opening the settings makes it die. Likely some problem with my environment.

Since support for the v2 scheduler has ended on Desktop – how old a version is that?! :sweat_smile:

But yes, if you’ve got a scheduler mis-match – especially an unexpected/never-tested one, all sorts of things could go wrong. Check your Database, and update your Desktop.

Now, I’m using on the desktop the freshly compiled version:

   Version 23.12.1 (1a1d4d54)
   Python 3.11.8 Qt 5.15.12 PyQt 5.15.10

Which is approximately the same as on Android. It suffers from the same problem: Rebuilding the deck yields non-deterministically random order. There’s no choice between v2/v3. It does, though, work on another Android phone that differs only in OS version, not Anki version.

Regarding check database and delete and recreate deck: I had tried these previously and only found the random order changes :face_with_raised_eyebrow: I have very little trust in this sort of hint because it’s Anki’s equivalent of “have you tried rebooting?”

As a work around, I can rebuild my deck on the other phone and learn wherever convenient. What do you think?

(edit: removed Unicode bidi markers which Anki’s UI [from which I copy/pasted] added around the version number)

The classics are classics for a reason – it’s because they frequently work!

Sure!

Are any of the cards gathered to the filtered deck in Learn (red)? Are they the ones that are being shown first?


So, to sum up – you’ve got two Android devices running AnkiDroid 2.17.6 [you mentioned an older OS – what are the devices and OS versions?], and a computer (Windows?) running Anki Desktop 23.12.1 – and of those 3, only one of the Android devices builds the deck as you expect [which one?], and the other Android device and Desktop don’t. Do I have that right?

Which device did you create the filtered deck on when you deleted and re-created it?

Oh no, actually, the deck was still half broken. The other device also stopped being able to create correct filtered decks. Now I’m a bit less confused. It seems this feature broke recently and I’ve noticed only now. I tried downgrading by a few minor versions, no effect.

Regarding red: I very rarely use red, so I cannot tell. Haven’t used it for over a month, it’s almost always too aggressive for my use case.

I would discount any (spurious) result from the old desktop version. They version I built now wasn’t from git (although I could try this, too). As a next step, I could try to git bisect the bug, provided I can find a “good” commit. That certainly takes some time, so I would use it as a last resort. On the other hand, if I find the commit that turned it “bad”, I should probably at least open a nice ticket (with a lot of luck a pull request, my Rust is worse then rusty) which is a lot nicer than spilling ink in a forum.

Do you know of any alternative shy of bisecting? Thank you for your invaluable insight!
A

I suppose it is possible that it is broken, but it works just fine for me on 2.17.6 and 23.12.1 – and I think there are a lot of variables that can still be eliminated.

I’m really not sure what you mean by that – we must be talking about different "red"s. I was talking about cards in the Learn state, which are displayed in red on the decks page.

Oh, no, if you’re building your own from scratch, then I tap out! :laughing: You need more help than I can possibly give.

Filtered decks will change the random order each time they’re rebuilt. Regular decks use a semi-consistent order, that gets changed when a card is modified.

But that’s only if you’ve selected ‘random order’. If you’ve selected ‘order added’, I would expect the order to be consistent.

Today, the filtered deck was behaving itself. If it stays like that, I’m happy. Just curious/furious what’s different now than yesterday.