Closed jmaas-onoffice closed 1 year ago
@dai-eastgate @LongTrong-exe This is quite a critical bug. The cycle ends Wednesday anyway, so finish up the bets, but then it would be great if you could prioritize diagnosing this bug to figure out a fix.
@dai-eastgate @LongTrong-exe This is quite a critical bug. The cycle ends Wednesday anyway, so finish up the bets, but then it would be great if you could prioritize diagnosing this bug to figure out a fix.
We will check and fix it.
If there is not a trivial fix, we can figure out a solution together. ;)
This not only happens, when I switch the token and secret, but whenever the credentials are invalid.
I think if api errorCode 500 instead of showing error we can show message to user and update default(API token and API secret). What do you think about this?
Oh, so it seems that the API was returning a different error code than our code expected. And because our code only handled that one specific error code, the exception was unhandled and crashed everything.
I just tested it again and now I can't reproduce the problem. It seems the API now responds with the expected error code.
But this issue demonstrates that we cannot allow exceptions to go unhandled here. I think it would be nice, though, to distinguish between a problem with the credentials and another exception.
So could we add an additional error message, when it's not an invalid credential exception, but something unexpected? In that case we would not want to tell the user that something is wrong with their credentials, but instead just that there is a problem with the API. In any case, we cannot allow unhandled exceptions here.
@jmaas-onoffice I added an additional error message when it is not an invalid credential exception. In the example, I reproduced the error. You can watch the video and give me feedback.
That looks good! The other pages are usable. 👍
So the most important requirement is that no exception should make all pages unusable. It's ok if the plugin's pages are unusable.
We could also improve the error message a bit:
""" The onOffice plugin has an unexpected problem when trying to reach the onOffice API.
Please check the onOffice server status to see if there are known problems. Otherwise, report the problem using the support form. """
When the fix is done, feel free to merge it into master and notify me. :)
That looks good! The other pages are usable. 👍
So the most important requirement is that no exception should make all pages unusable. It's ok if the plugin's pages are unusable.
We could also improve the error message a bit:
""" The onOffice plugin has an unexpected problem when trying to reach the onOffice API.
Please check the onOffice server status to see if there are known problems. Otherwise, report the problem using the support form. """
When the fix is done, feel free to merge it into master and notify me. :)
@jmaas-onoffice yes, I fixed it and merged it into master
When I enter invalid API credentials (for example I mistype the token, or I switch token and secret), on every page load there is a fatal error that prevents the UI from fully showing. This breaks the entire website.
To get the website working again, you need to disable the plugin, e.g. by renaming its folder via FTP, and then go to /wp-admin/options.php and fix the credentials (search for
onoffice-settings-apisecret
). Or you can deinstall and reinstall the plugin to reset the settings.The error message is: