Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Bug: session.cancelQueued 工作不正常 #630

Closed
Tracked by #615
DrLee-lihr opened this issue Apr 22, 2022 · 0 comments
Closed
Tracked by #615

Bug: session.cancelQueued 工作不正常 #630

DrLee-lihr opened this issue Apr 22, 2022 · 0 comments

Comments

@DrLee-lihr
Copy link
Contributor

Describe the bug

在调用连续多个 session.sendQueued 后,如果中途执行 session.cancelQueued ,则之后的所有消息并不会都被取消发送。

Steps to reproduce

例:

[1,2,3,4,5,6,7].forEach(i => {
  session.sendQueued(i.toString())
});
let midware = ctx.middleware((session_1, next) => {
  if(session_1.content="stop"){
    midware()

    //here -> it doesn't work properly
    session.cancelQueued(1000)

    return "已停止。"
  }
  else return next()
},true);

Expected behavior

在该方法执行后,停止之后所有信息的发送

实际行为:只会取消一条,且传入的参数 delay 会应用在下一条(被取消的那一条的下一条)的发送上;之后的消息发送并不受影响。

Screenshots

No response

Versions

  • OS: Windows 10
  • Platform: all (tested on sandbox and discord)
  • Node version: v16.14.0
  • Koishi version: 4.6.0 / 4.5.2 均可以复现

Additional context

No response

@DrLee-lihr DrLee-lihr added the bug BUG label Apr 22, 2022
DrLee-lihr added a commit to DrLee-lihr/koishi that referenced this issue May 5, 2022
DrLee-lihr added a commit to DrLee-lihr/koishi that referenced this issue May 5, 2022
DrLee-lihr added a commit to DrLee-lihr/koishi that referenced this issue May 5, 2022
DrLee-lihr added a commit to DrLee-lihr/koishi that referenced this issue May 5, 2022
DrLee-lihr added a commit to DrLee-lihr/koishi that referenced this issue May 6, 2022
DrLee-lihr added a commit to DrLee-lihr/koishi that referenced this issue May 8, 2022
@shigma shigma closed this as completed in 722366d May 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants