UX: Improve ‘invalid params provided’ error
Users don’t know how to resolve this error, and we don’t auto-fix it:
Maybe using something similar to deck-config-invalid-parameters (if the error is similar): The provided FSRS parameters are invalid. Leave them blank to use the default parameters.
Originally reported on https://forums.ankiweb.net/t/ux-improve-invalid-params-provided-error/65557/2
Linking to a new FAQ would be good too.
Hi! I’d like to work on this issue. Is it available?
Does this really need a fix on Anki's side? I think that fsrs-rs is returning a vague error and it should ideally determine what is wrong and return a specific error message.
For example, in the following code, it isn't clear whether the revlog is abnormal or the parameters are abnormal.
https://github.com/open-spaced-repetition/fsrs-rs/blob/58b0fb23b589bb99eed13eb481fc164dde81a1e3/src/inference.rs#L176-L177
@L-M-Sherlock
If this error is sometimes triggered by bad revlog data, agreed that we need a better error to make it clearer. But I was under the impression the common case is the user has managed to get invalid params into their deck presets. The current error message was lazy/brief because the assumption was that Anki would be validating these params prior to saving, and users wouldn't hit this unless they were manually modifying the collection. I presume we don't currently know how the invalid params are getting into the collection, and what they look like?
Given the number of reports, perhaps we should consider falling back on the default params instead of throwing an error if the params are invalid?
But I was under the impression the common case is the user has managed to get invalid params into their deck presets.
That's probably the most common cause. But, just by looking at the code, having bad revlog data can also trigger the issue. I don't have any confirmed reports of such cases, though.
I presume we don't currently know how the invalid params are getting into the collection, and what they look like?
Just a few versions ago, Anki wasn't validating the parameters before saving them into the collection and due to a "bug" in accessing the saved params, they were not used.
- https://github.com/ankitects/anki/pull/4052
~~So, these reports are likely from those people who saved invalid params with previous versions and have now updated to the latest version.~~
But, such issues will be picked by check_and_fill_parameters in https://github.com/open-spaced-repetition/fsrs-rs/blob/0187b45608ec9470b74f289aaaf0069b458220df/src/model.rs#L316 and return FSRSError::InvalidParameters
So, probably, these reports are caused by parameters that have the correct count but their values are quite different from the reasonable ones.
perhaps we should consider falling back on the default params instead of throwing an error if the params are invalid?
The drawback of this approach is that the user will never know that something is wrong in their configaration. We should probably suggest them to press optimize to try to fix the issue.
The other PR that tries to make the parameters field uneditable / show a warning will hopefully make this issue less common in the future.
The drawback of this approach is that the user will never know that something is wrong in their configaration.
This is a valid point (and one I'd considered), but I'm not sure forcing the user to figure out how to clear the error / support channels to help them is worth the benefits of letting them know.
Has this been solved by #4342?
Might be best to keep it open as a reminder to figure out the root cause.