Rebuilding filtered deck on experimental v2 empties deck and reschedules to the year 1745

The AnKing's Avatar

The AnKing

18 Sep, 2019 04:19 PM

I've been testing the experimental v2 scheduler and I've been able to consistently reproduce an error. If I make a filtered deck with criteria "deck name" is:due prop:due>-1 it will pull in the cards due today. However, when I rebuild it, it will remove everything from the deck and all the cards that were in the deck now have random dates in the year 1745.

I checked and this still occurs even with all add-ons disabled

I did the EXACT same thing step by step in a profile that syncs, and it did NOT have this issue.

Image of rescheduled due dates: https://imgur.com/a/NjvD0fp

Deck that I was using: https://drive.google.com/open?id=1N72zCZ29MivkBYGMz-_IZflei5UOYKId

  1. 1 Posted by ijg on 18 Sep, 2019 05:07 PM

    ijg's Avatar

    I think this problem can be re-created as outlined in [1] in Anki 2.1.15 without any add-ons. As always: I'm not a programmer ...

    [1]

    • create a new profile
    • import an old deck that contains cards in the state review that were due in the past. "card.due" is relative to the collection creation so they have values like 'due': -15
    • switch to the v2 scheduler
    • build a filtered deck and empty it.
    • Now the card that has the lowest due date has 'due': -100000 which is roughly 275 years ago in 1745.

    the function _fillDyn contains due = (case when odue>0 then odue else due end). When you create a filtered deck with _moveToDyn you set "odue = due".

  2. Support Staff 2 Posted by Damien Elmes on 18 Sep, 2019 11:42 PM

    Damien Elmes's Avatar

    The filtered deck code isn't expecting due dates before the creation of the collection. Thanks for the report, I've made a note to look into it.

  3. 3 Posted by The AnKing on 19 Sep, 2019 12:27 AM

    The AnKing's Avatar

    Is there a reason why this would only cause issues when in a profile not associated with an account? Or will it still cause issues in an account associated profile? I don't want to use the v2 scheduler filtered decks if its going to screw up scheduling in the future

  4. Support Staff 4 Posted by Damien Elmes on 20 Sep, 2019 02:13 AM

    Damien Elmes's Avatar

    It is not connected with syncing. It will only happen if you import cards with existing scheduling into a collection that was created more recently than the cards were due - most users will not encounter the issue. If you reset the cards or reschedule them to be due after the collection creation date, it should resolve the issue.

  5. Support Staff 5 Posted by Damien Elmes on 24 Sep, 2019 08:22 AM

    Damien Elmes's Avatar
  6. 6 Posted by The AnKing on 24 Sep, 2019 08:35 PM

    The AnKing's Avatar

    Awesome! Thanks for addressing that!

  7. 7 Posted by lovac42 on 02 Oct, 2019 12:59 AM

    lovac42's Avatar

    @dae:

    Is there any reason you choose to fix it this way? I see a different way of coding it by changing odue>0 to odue!=0 in the emptyDyn method: https://github.com/dae/anki/blob/master/anki/schedv2.py#L1034

    This will also prevent addons that causes unintentional negative odues from screwing up the card schedules in a filtered deck. Such as: https://github.com/Arthur-Milchior/Anki-postpone-reviews/blob/master/init.py#L45-L46

    Or is negative odues reserved for something else in V2?

  8. Support Staff 8 Posted by Damien Elmes on 02 Oct, 2019 02:50 AM

    Damien Elmes's Avatar

    IIRC, it would not solve the problem for cards with a due date of 0 (eg cards rescheduled to today on the first day user starts using Anki, cards imported with scheduling from another collection, etc)

  9. 9 Posted by lovac42 on 02 Oct, 2019 03:37 AM

    lovac42's Avatar

    I see, it would be nice to revise the SQL query to fix this in a more straight forward way, but I understand it can't be done immediately. Thanks. And I'll contact Arthur to update his addon.

  10. 10 Posted by arthur on 16 Oct, 2019 04:51 AM

    arthur's Avatar
  11. Support Staff 11 Posted by Damien Elmes on 16 Oct, 2019 11:02 AM

    Damien Elmes's Avatar

    I presume that's the wrong link, but thank you for porting the change.

  12. 12 Posted by arthur on 16 Oct, 2019 07:14 PM

    arthur's Avatar

    Link edited

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac