fix: reset fcitx state after stream completes#39
Closed
bincat233 wants to merge 1 commit intoXinkai:masterfrom
Closed
fix: reset fcitx state after stream completes#39bincat233 wants to merge 1 commit intoXinkai:masterfrom
bincat233 wants to merge 1 commit intoXinkai:masterfrom
Conversation
Owner
|
@bincat233 你在这个PR里加的三行正是我之前删掉的三行。https://github.com/Xinkai/dictype/pull/23/changes#diff-0ab2017360bb3a808f90bfd33c7f87b34b719f400908fa5dac9c6cf8f58e45eeL19-L21 删掉这三行的原因是,原本在Errored状态下,UI会瞬间消失,报错信息都看不到。所以我把这个状态重置逻辑改到了每次新请求的时候。(或者用户重新使用键盘打字也可以重置) |
Owner
|
in favor of #41 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
这个改动主要是在补 #32 里第二个问题。
我这边复现下来,网络正常时也会出现这样一条链路:
第一次 trigger key 正常进入 connecting / transcribing,第二次正常进入 stopping,但这一轮结束之后,下一次再按 trigger key,UI 还是停在 stopping,不过录音和上屏其实又重新开始了;再按一次也不会按预期停掉。
看下来原因不在服务端,而是在 fcitx 侧的
DictypeState。流结束后clear()会清空文本,但没有把 stage 复位回Closed,所以前一轮留下来的Stopping状态会带到下一轮。这样后面的 trigger key 行为就会变乱:界面一直显示 stopping,但实际又在重新录音和上屏。这个 PR 做的事情很小:
DictypeState::clear()里把 stage 复位到Closed我本地按 #32 里的描述复现后,修完再测,第二轮开始/停止已经恢复正常。
本地验证:
./build-test/DictypeFcitx/dictype_state_tests