Decks with trailing spaces

There are multiple problems with decks.
First, it seems that you now trim deck name.
I do prefer “Theory ::Mathematics ::Algebra ::Group ”, but names were changed to “Theory::Mathematics::Algebra::Group”
This is a problem mostly because, without space, it makes very long non breakable lines, which breaks the HTML rendering of question (I show deck name in question)

I have not yet understood what exactly did occur, but I now suddenly have a lot of decks which are duplicated.
On ankidroid and older anki, I see toplevel decks “Theory” and "Theory ". “Theory” have some of the subdecks while "Theory " have some other subdecks. I had not yet time to learn rust, so I can’t read code to check my intuition, but I believe that what ocurred is probably that the name "Theory " was corrected to “Theory” but the name of “Theory ::Mathematics ::Algebra ::Group ” was corrected into “Theory ::Mathematics ::Algebra ::Group” and displayed as “Theory::Mathematics::Algebra::Group ”

As a related note, the default deck is back in the deck selection window, even when it is not shown in the deck browser

Unrelated note, please let me know if I should put it elsewhere: the window to reply is far too small. My reply is long, and a very small window is not really practical. It seems I can’t change it’s size.

By the way, I can’t sync anymore. It keeps telling me to check the database, and even if I check it without add-on, and try to sync again, it tells me to check the database again. I believe that both problem may be related, but may be entirely wrong.

The trimming happens on each component, so simply updating should not result in duplicates. It’s likely caused by having the old deck names on your other clients and them getting mixed together - reverting to a backup and then forcing a full sync immediately after upgrading will likely prevent that from happening. If that does not also resolve your syncing issue, please let me know your AnkiWeb ID in a private message.

Trailing spaces are usually user error rather than a deliberate choice, so rather than restore the old behaviour, I’d recommend you use a little Javascript on your card to modify the displayed deck name to your liking, such as replacing the :: with a space.

Some users want to be able to add cards to the default deck: Backend.get_deck_names doesn't return Default deck

The reply window has a handle at the top which can be dragged up and down to resize it.

1 Like

Here is how to reproduce a problem without add-on, with current master branch of anki and ankidroid.

  1. Create a deck with trailing spaces, such as " SPACE ". I did it using ankidroid
  2. Sync to current anki master, see that the deck has been renamed to “SPACE” (e.g. by doing
aqt import mw
print(mw.col.decks.byName("SPACE"))

in the debugger)
3. Add a deck “SPACE::Second”
4. tries to sync

I receive a message telling me to check database
5. Checking database
6. Trying to sync
It still fails and tells to check database

So there is something wrong with sync when a deck has been stripped from its spaces.

Since stripping should occur in ankidroid eventually, I created a note on our github here: https://github.com/ankidroid/Anki-Android/issues/6452