Anki-Android
Anki-Android copied to clipboard
Add and remove card types triggers a full sync even if user discards changes
Something I noticed while poking around CardTemplateEditor.java and TemporaryModel.java:
Reproduction Steps
- Add or remove a card type
- Agree to the full sync prompt
- Back out and discard changes
- Sync
Expected Result
Since the changes (either add or remove) were discarded, a full sync shouldn't be needed
Actual Result
Full sync is required
Debug info
Refer to the support page if you are unsure where to get the "debug info".
AnkiDroid Version = 2.12alpha3
Android Version = 7.0
ACRA UUID = 0f431910-fac3-4b52-ba37-64f328e5d239
Research
Enter an [x] character to confirm the points below:
- [x ] I have read the support page and am reporting a bug or enhancement request specific to AnkiDroid
- [x ] I have checked the manual and the FAQ and could not find a solution to my issue
- [x ] I have searched for similar existing issues here and on the user forum
- [x ] (Optional) I have confirmed the issue is not resolved in the latest alpha release (instructions)
Unfortunately, once you trigger that I don't think it's possible to un-trigger it, but it does bear looking at, maybe it is possible to un-trigger that if the user doesn't save changes and I just missed it
Incidentally, all the usage you are doing on CardTemplateEditor is much appreciated, it's not the most heavily used area of the code but it just saw so much change that more testing == more better :-)
Unfortunately, once you trigger that I don't think it's possible to un-trigger it, but it does bear looking at, maybe it is possible to un-trigger that if the user doesn't save changes and I just missed it
I haven't looked into too much, but perhaps we can move the try
/ catch
block and mTemplateEditor.getCol().modSchema();
line into the function that saves the model. Perhaps a separate prompt when adding/removing a card type saying "If you save this note type after adding or removing a card type, a full collection sync will be required" with an Ok
button. I probably didn't explain this well, but I'll try it and get back to you.
No - that was discussed quite a bit during development of 5151. The prompt for full sync needs to be associated-in-time with the action the user does that requires it, even though we don't actually do the save right then. That's inline with desktop actually.
I don't think full sync is undoable on Anki Desktop either is it...?
On Tue, Jun 16, 2020 at 3:03 PM Mike Hardy [email protected] wrote:
No - that was discussed quite a bit during development of 5151. The prompt for full sync needs to be associated-in-time with the action the user does that requires it, even though we don't actually do the save right then. That's inline with desktop actually.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ankidroid/Anki-Android/issues/6475#issuecomment-644503137, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAVQBYXQOCW3BPQKUDEP7LDRW3OJJANCNFSM4N6ZALQA .
I don't think desktop collects changes made on the template screen, thus once an add/delete template change is made, there is no way to undo (other than download from ankiweb or restore a backup). It looks like this behavior is planned for desktop though (quoting from the 2.1.28alpha1 release notes):
`Card template screen:
Changes are now accumulated, and can be saved or discarded when you close the screen.`
I don't use the desktop alphas, so I can't comment.
EDIT: the discarding of changes feature is now in stable desktop Anki
True, could be something we get 'for free' by switching to rust then
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
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
@sudomain this should be fixed in 2.17, could you confirm when you have a second
I reproduced it just now on 2.17beta3