Closed passos closed 2 years ago
Thank you for your feedback, I will check it later.
You can try using the latest version to see if the problem still exists.
https://github.com/tisfeng/Raycast-Easydict/releases/tag/1.4.0
Looking at the logs I've got some idea, but I can't reproduce the problem on my end, can you describe in detail the steps to reproduce it? For example, what is the input text and does this problem occur every time or only in special cases? @passos
This issue/pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs in the next 7 days to keep our backlog clean. Thanks for your contributions.
This bug should be fixed in the latest version, please test and verify it and let me know the result. Thanks
@tisfeng I have updated the extension to the latest version and the crash is still there.
I tried to clone your code and debug in dev mode. It turns out the problem is the extension is trying to call Youdao's API when it's been launched. However, the domain youdao.com
is considered insecurely in my network environment and been blocked. So the call to this API will fail every time the extension been launched. And it will crash at background because the Promise error is not caught.
The current implementation will do this no matter Youdao translation service is disabled in preference or not. I disabled the call getYoudaoWebCookie();
at https://github.com/raycast/extensions/blob/main/extensions/easydict/src/dictionary/youdao/youdao.ts#L41 then it works now.
There is another issue related to this one. I noticed that when query the word, even I only has Google translation enabled and all the other translation services and options disabled (includes "Detect Language Speed First") in extension preference, but it still sends query requests to https://fanyi.baidu.com
, https://www.bing.com
and https://translate.google.cn
.
I think it should follow the preference and don't send any request to the translation service if that translation service is disabled. Otherwise, it might cause the same issue like this one.
OK, I know this problem, thanks for your patient feedback.
First of all, I really didn't think about the possible error of getting the Youdao web cookie, which is too strange in your case. And getYoudaoWebCookie()
this method is called every time the extension is started, to reduce the response time of subsequent Youdao requests. I will fix it later.
Regarding the second point you mentioned, it is actually normal, because the whole translation process is divided into two steps, the first one is to detect the text first, and the second one is to request the corresponding translation API. And in order to accurately detect the input, I have used Tencent, Baidu, Bing and Google for a total of four language detection API, and they will concurrently request once the text is input, which will not slow the speed.
In addition, I have made a special treatment for the language detection module, even if some of them fail to request, under normal circumstances will not cause the extension to crash, just may not be detected so accurately, so don't have to worry about this.
The latest version should have fixed the above bug, https://github.com/tisfeng/Raycast-Easydict/commit/0c11ace2667a39b81421c3c04f181267eeeec2f9 , you can test it out. If there is no problem, I will release a fixed version later.
Thanks for the fix. It's not crash anymore with this update.
Btw, regard to the language detection feature, I turned off the option "Detect Language Speed First" and also set the "First Language" and "Second Language" it still requests to previous API endpoints (Google, Bing, Baidu, Tencent, Youdao, ...). I would love to have an option that can turn off this feature because I personally don't want to send my data to Tencent, Baidu or Youdao. Of course, this is nothing related to the crash in this issue.
The current language detection module will request all language detect APIs concurrently, and the Detect Language Speed First
option only means to save time by quickly confirming the language type while maintaining as much accuracy as possible.
I already know your needs, in the future I may add an option to use only the language detection APIs of the services the user has turned on, for example, if only Google and Bing Translate are turned on, only those two language detection APIs will be used. But this may result in inaccurate language detection, as well as slowness. This is planned for future development, low priority.
Hi @passos, I've just released a new version with improvements to privacy issues https://github.com/raycast/extensions/pull/3061
Privacy improvement: Except for Google and Bing language detection (no key required, no personal information will be recorded!), other language detection will only be enabled when the corresponding translation engine is turned on by the user.
However, please note that in general the more language detection API there are, the faster the query response will be, and conversely, if only Google and Bing language detection API is used, the speed may be slow.
Extension – Easy Dictionary
Author: @tisfeng
Description
Easy Dictionary went wrong when search wrod
Error:
Steps To Reproduce
The current behavior
report "Something went wrong"
The expected behavior
show the word explaination
Raycast version
Version: 1.38.2