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

[Bug] card due count doesn't match with Anki Desktop after sync #9368

Closed
david-allison opened this issue Aug 4, 2021 · 11 comments
Closed

[Bug] card due count doesn't match with Anki Desktop after sync #9368

david-allison opened this issue Aug 4, 2021 · 11 comments
Labels
Bug Can't reproduce bugs people file that we can't reproduce Help Wanted Requesting Pull Requests from volunteers Keep Open avoids the stale bot Priority-High V2 Scheduler

Comments

@david-allison
Copy link
Member

david-allison commented Aug 4, 2021

This is with the "legacy timezone" code

See: https://forums.ankiweb.net/t/anki-droid-card-due-dont-match-with-anki-desktop/10955

This can be fixed by: "Anki Desktop - Preferences - Scheduling - Disable "legacy" timezone", but the code should match, and it doesn't currently

@david-allison david-allison added Can't reproduce bugs people file that we can't reproduce Help Wanted Requesting Pull Requests from volunteers labels Aug 6, 2021
@david-allison
Copy link
Member Author

Tried and can't repro this. Definitely a problem

@cafce25
Copy link

cafce25 commented Aug 9, 2021

I have that problem, using UTC as my timezone everywhere, AnkiWeb and Desktop agree on the cards due and times, AnkiDroid disagrees. If anybody could point me to were this issue might be I can try to create a patch but I don't know the codebase at all.

@david-allison
Copy link
Member Author

Perfect, thanks!

I believe it'll be a difference in the results of these variables on Android and Anki Desktop:

mToday = _daysSinceCreation();
mDayCutoff = _dayCutoff();

The Android values can be accessed via a debugger.

The Anki Desktop code to obtain these values is:

  • Open console (Ctrl+Shift+;)/(Ctrl+Shift+Colon)
pp(mw.col.sched.today)
pp(mw.col.sched.dayCutoff)

Latest Anki code is: https://github.com/ankitects/anki/blob/main/pylib/anki/scheduler/v2.py

@david-allison david-allison changed the title [Bug] AnkiDroid Card due doesn't match with Anki Desktop [Bug] card due count doesn't match with Anki Desktop after sync Aug 16, 2021
@david-allison david-allison pinned this issue Aug 30, 2021
@YoungMind1
Copy link

I have the same problem, my timezone is UTC +3:30 Tehran
this problem happened to me the day we changed the clocks(Daylight saving time thingy)
my android is on 20 59
while my ankiWeb and desktop are on 20 61

@AarjavPatni
Copy link

AarjavPatni commented Oct 5, 2021

I'm facing a similar problem. The card count on AnkiDroid and Anki Desktop don't match for me until late in the evening when they finally show identical number of due cards. Until then, AnkiDroid says I have zero cards due and I'm unable to review any cards until the evening, which has led me to miss days.
image image
Anki Desktop (Left) and AnkiDroid (Right)

@david-allison
Copy link
Member Author

david-allison commented Oct 5, 2021

Updated the OP with a solution for end-users. I can't reproduce this issue. This thread is designed to help find users who can debug and determine why it's occurring.

@david-allison
Copy link
Member Author

Very likely related: #5637

@github-actions
Copy link
Contributor

Hello 👋, this issue has been opened for more than 2 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 github-actions bot added the Stale label Dec 21, 2021
@david-allison david-allison reopened this Jan 6, 2022
@david-allison david-allison added Keep Open avoids the stale bot and removed Stale labels Jan 6, 2022
@nickhod
Copy link

nickhod commented Feb 23, 2022

I also had this issue. Anki Web and Anki Desktop match cards due count, AnkiDroid is showing 0 new cards due.

I disabled "Legacy Timezone Handling" in Anki Desktop, resynced AnkiDroid and it's now working correctly.

@ShridharGoel ShridharGoel unpinned this issue Mar 17, 2022
@ShridharGoel ShridharGoel pinned this issue Mar 17, 2022
@pt-94
Copy link

pt-94 commented Apr 10, 2022

I had this issue. I'll try to be as detailed as possible to reproduce this.

I started with a new account and fresh installation.

I created my custom note-type, deck and cards on Anki desktop.
I created an Anki account and syncronized the collection.
I opened Ankidroid and syncronized.
I changed the deck options from mobile and syncronized. I did my daily cards.
The next day I opened the app and found out my due count to 0. On desktop it was showing a correct due count.

I solved as other did, disabling "Legacy Timezone Handling" on desktop.

@lukstbit lukstbit unpinned this issue Jun 25, 2022
@ShridharGoel ShridharGoel pinned this issue Jun 25, 2022
@ShridharGoel ShridharGoel unpinned this issue Jun 25, 2022
@ShridharGoel ShridharGoel pinned this issue Jun 25, 2022
@ShridharGoel ShridharGoel unpinned this issue Jun 25, 2022
@ShridharGoel ShridharGoel pinned this issue Jun 25, 2022
dae added a commit to ankitects/anki that referenced this issue Jul 18, 2022
dae added a commit to ankitects/Anki-Android that referenced this issue Jul 18, 2022
dae added a commit to ankitects/Anki-Android that referenced this issue Jul 20, 2022
I expect this fixes ankidroid#9368

Bumps the backend version, since the API changed.
dae added a commit to ankitects/Anki-Android that referenced this issue Jul 22, 2022
I expect this fixes ankidroid#9368

Bumps the backend version, since the API changed.

Closes ankidroid#11881
dae added a commit to ankitects/Anki-Android that referenced this issue Jul 22, 2022
I expect this fixes ankidroid#9368

Bumps the backend version, since the API changed.

Closes ankidroid#11881
dae added a commit to ankitects/Anki-Android that referenced this issue Jul 22, 2022
I expect this fixes ankidroid#9368

Bumps the backend version, since the API changed.

Closes ankidroid#11881
dae added a commit to ankitects/Anki-Android that referenced this issue Jul 23, 2022
I expect this fixes ankidroid#9368

Bumps the backend version, since the API changed.

Closes ankidroid#11881
dae added a commit to ankitects/Anki-Android that referenced this issue Jul 24, 2022
I expect this fixes ankidroid#9368

Bumps the backend version, since the API changed.

Closes ankidroid#11881
dae added a commit to ankitects/Anki-Android that referenced this issue Jul 24, 2022
I expect this fixes ankidroid#9368

Bumps the backend version, since the API changed.

Closes ankidroid#11881
@BrayanDSO
Copy link
Member

As this is closed, I think this can be unpinned

bennettj12 added a commit to bennettj12/Anki-Android that referenced this issue Jul 30, 2022
kotlincleanup: additional uses of .apply

Reduce the API surface of AbstractSched

Initial prep work for adding the V3 scheduler. Removed some methods that
are only used internally, and defined some overloads concretely.

eta() implementation in v1 appeared to be functionally identical to v2,
despite the comment.

Remove setReportLimit()

It was introduced due to ankidroid#5666, but AnkiWeb has ignored the due counts
in the sanity check for about 18 months, so this is no longer necessary.

Also remove _updateCutoff() and _checkDay() from the public API.

Split majority of AbstractSched into BaseSched

- Mirrors the code layout of the desktop version, where routines like
buryCard(), that are not specific to V2 or V3, are stored in a separate
file. This leaves AbstractSched containing only the methods that will
need to be implemented separately for V3.
- Moves some methods from SchedV2 into BaseSched, as V3 will want to
use them as well for now.
- Some of the routines in BaseSched will only work with a schema upgrade.
For now, SchedV2 overrides these so they continue to work with the
legacy schema.

Add support for the V3 scheduler

Add V3 scheduler tests

Like the desktop, this works by using a single set of tests that
alter some of the checks depending on the active scheduler version,
so that code duplication is avoided.

Use backend to calculate legacy timezone

I expect this fixes ankidroid#9368

Bumps the backend version, since the API changed.

Closes ankidroid#11881

Backend language tweaks

- Move logic from backend into frontend, so a new backend release is
not required
- Fix mapping of Chinese languages and Hindi; check others
- Don't require a restart after changing language in prefs

Fix LeakCanary warning when changing language/v16 schema

After discarding the backend, Preferences was calling getCol and passing
itself in as the context. This caused the preferences screen to be retained
as the backend lives on. By switching to AnkiDroidApp, a leak can be
avoided.

Fix some connected tests failing when legacy_schema=false

Some were irrelevant; the ones in ContentProviderTest need investigating.

Updated strings from Crowdin

Bumped version to 2.16alpha76

more uses of .apply

reintroduced null checks and removed specified nullable type
@mikehardy mikehardy unpinned this issue Jul 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Can't reproduce bugs people file that we can't reproduce Help Wanted Requesting Pull Requests from volunteers Keep Open avoids the stale bot Priority-High V2 Scheduler
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants