Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

修复 Timeout waiting for ConfigPush. 掉线问题 #2834

Merged
merged 1 commit into from
Feb 22, 2024

Conversation

zhaodice
Copy link
Contributor

May help #2824
分析原因: 很可能是因为使用了 IllegalStateException ,导致无法正常进入QQAndroidNBot.kt下的
cause is NetworkException && cause.recoverable 分支,因为IllegalStateException不是NetworkException,直接走了else-> 把bot给manual closed了

            StateChangedObserver("BotOfflineEventBroadcasterAfter", State.OK, State.CLOSED) { new ->
                // logging performed by BotOfflineEventMonitor
                val cause = new.getCause()
                when {
                    cause is ForceOfflineException -> {
                        eventDispatcher.broadcastAsync(BotOfflineEvent.Force(bot, cause.title, cause.message))
                    }

                    cause is StatSvc.ReqMSFOffline.MsfOfflineToken -> {
                        eventDispatcher.broadcastAsync(BotOfflineEvent.MsfOffline(bot, cause))
                    }

                    cause is NetworkException && cause.recoverable -> {
                        eventDispatcher.broadcastAsync(BotOfflineEvent.Dropped(bot, cause))
                    }

                    cause is BotClosedByEvent -> {
                    }

                    else -> {
                        // any other unexpected exceptions considered as an error

                        // When bot is closed, eventDispatcher.isActive will be false.
                        // While in TestEventDispatcherImpl, eventDispatcher.isActive will always be true to enable catching the event.
                        if (eventDispatcher.isActive) {
                            eventDispatcher.broadcastAsync { BotOfflineEvent.Active(bot, cause) }
                        } else {
                            @OptIn(DelicateCoroutinesApi::class)
                            GlobalScope.launch {
                                BotOfflineEvent.Active(bot, cause).broadcast()
                            }
                        }
                    }
                }
            },

@zhaodice
Copy link
Contributor Author

这个bug可能一直都有,只是最近tx在搞服务器切换的把戏所以就不定时的开始出问题

@kkgg0521
Copy link

kkgg0521 commented Feb 7, 2024

这个bug可能一直都有,只是最近tx在搞服务器切换的把戏所以就不定时的开始出问题

大哥 go-cqhttp能搞吗 我愿意付费

@zhaodice
Copy link
Contributor Author

zhaodice commented Feb 7, 2024

这个bug可能一直都有,只是最近tx在搞服务器切换的把戏所以就不定时的开始出问题

大哥 go-cqhttp能搞吗 我愿意付费

泻药,不学golang,我也就是稍微fork了一下mirai的源码稍微修修自己能用就行了(

@kkgg0521
Copy link

kkgg0521 commented Feb 7, 2024

这个bug可能一直都有,只是最近tx在搞服务器切换的把戏所以就不定时的开始出问题

大哥 go-cqhttp能搞吗 我愿意付费

泻药,不学golang,我也就是稍微fork了一下mirai的源码稍微修修自己能用就行了(

大哥能搞成mcl 那个么 我不太会用这个

@zhaodice
Copy link
Contributor Author

zhaodice commented Feb 7, 2024

这个bug可能一直都有,只是最近tx在搞服务器切换的把戏所以就不定时的开始出问题

大哥 go-cqhttp能搞吗 我愿意付费

泻药,不学golang,我也就是稍微fork了一下mirai的源码稍微修修自己能用就行了(

大哥能搞成mcl 那个么 我不太会用这个

我从来没用过mcl,我都是直接IDEA拉依赖然后直接启动console的(而且我已经放弃PC端了,我的mirai项目全部只在安卓机跑

@Him188 Him188 merged commit b7eb6eb into mamoe:dev Feb 22, 2024
1 check passed
@wenxin1114
Copy link

佬,怎么编译呢,我需要在idea中使用

@MrXiaoM
Copy link
Contributor

MrXiaoM commented Nov 24, 2024

@zhaodice zhaodice deleted the patch-3 branch December 2, 2024 19:15
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants