Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@iamllama
Copy link
Contributor

@iamllama iamllama commented Mar 23, 2025

For ergonomics, day limits aren't cleared* when not used. Instead, a hack is used whereby its set as if it were in the past and thus not applicable on the current day

This is problematic when importing because the current day depends on the collection's age, and so an imported deck's "past" day limit might fall within the importing collection's "future" if the importing col is newer

This means that the imported deck's today limit might turn itself on in the future, even if it was considered to be a past value when the deck was exported. Or, more commonly, when importing a deck that has a valid today limit in the orig col, it isn't applied because the importing col has a different today.

This pr proposes to fix that by shifting correcting the day limit dates back accordingly** when importing, or removing them if the situation described in #3877 would occur. Sorry in advance if i've screwed up the math, it's a bit confusing EDIT: used a simpler approach that should also be more consistent

*changed in #3877, but the problem described here remains
**analogous to shifting back correcting imported cards' due dates

@iamllama iamllama marked this pull request as draft March 23, 2025 06:07
@iamllama iamllama force-pushed the fix-importing-day-limits branch from b6c4f9c to 57d2533 Compare March 23, 2025 06:48
@iamllama iamllama marked this pull request as ready for review March 23, 2025 06:57
@dae
Copy link
Member

dae commented Mar 24, 2025

Thanks @iamllama! The added test is appreciated too. :-)

@dae dae merged commit 45bb568 into ankitects:main Mar 24, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants