Skip to content

Release: v1.8.0 #210

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

Merged
merged 14 commits into from
May 19, 2025
Merged

Release: v1.8.0 #210

merged 14 commits into from
May 19, 2025

Conversation

ForliyScarlet
Copy link
Member

No description provided.

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This release (v1.8.0) introduces support for customizable event resolution via a new CustomEventResolver API, refactors the event parsing pipeline in OneBotBotImpl, and adds URL/method helpers to the OneBot API interface.

  • Add new exception types (EventResolveException, CustomEventResolveException) and interfaces (CustomEventResolver, CustomKotlinSerializationEventResolver)
  • Refactor OneBotBotImpl to extract resolveEvent/resolveRawEvent returning RawEventResolveResult and wire in custom resolvers
  • Extend OneBotApi with method, resolveUrlAction, resolveUrlExtensions, and update request implementations

Reviewed Changes

Copilot reviewed 29 out of 29 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
EventResolveException.kt New exception for event resolution errors
CustomKotlinSerializationEventResolver.kt Fun‐interface for Kotlin Serialization–based resolvers
CustomEventResolver.kt / CustomEventResolveException.kt Core resolver API and exception
OneBotBotImpl.kt Extracted resolveEvent, integrated custom resolvers, updated pipeline
OneBotBotConfiguration.kt Configuration hooks for registering custom resolvers
OneBotApi.kt / OneBotApiRequests.kt Added HTTP method & URL resolution extension points
build.gradle.kts & wrapper Bumped Gradle, dependency visibility tweaks
buildSrc / workflows Task registration, version bumps, workflow args updates
Comments suppressed due to low confidence (3)

simbot-component-onebot-v11/simbot-component-onebot-v11-core/src/commonMain/kotlin/love/forte/simbot/component/onebot/v11/core/bot/internal/OneBotBotImpl.kt:795

  • Only SerializationException is caught here but decodeFromJsonElement can also throw IllegalArgumentException; consider adding a catch for IllegalArgumentException to wrap it into the result rather than letting it propagate.
catch (serEx: SerializationException) {

buildSrc/src/main/kotlin/JvmConfig.kt:32

  • [nitpick] Removing withJava() may disable automatic Java source-set support for mixed Kotlin/Java projects; verify that this change won't break Java interop or compilation of Java code.
withJava()

simbot-component-onebot-v11/simbot-component-onebot-v11-core/build.gradle.kts:108

  • Changing the Ktor Java client from api to implementation hides it from downstream consumers; ensure no public API requires exposing this dependency.
implementation(libs.ktor.client.java)

Comment on lines +20 to +21
return serializer(context)?.let {
return context.json.decodeFromJsonElement(it, context.rawEventResolveResult.json)
Copy link
Preview

Copilot AI May 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The nested return inside the let lambda prevents the outer expression from compiling as intended and is redundant; instead, use serializer(context)?.let { context.json.decodeFromJsonElement(it, context.rawEventResolveResult.json) } followed by a single return or an explicit return null if no serializer is found.

Suggested change
return serializer(context)?.let {
return context.json.decodeFromJsonElement(it, context.rawEventResolveResult.json)
return serializer(context)?.let {
context.json.decodeFromJsonElement(it, context.rawEventResolveResult.json)

Copilot uses AI. Check for mistakes.

Comment on lines 503 to +507
// 接收的事件解析出现错误,
// 这应该是预期外的情况,
// 直接终止 session, 但是不终止 Bot,
// 只有当重连次数用尽才考虑终止 Bot。
// TODO 终止session吗?
Copy link
Preview

Copilot AI May 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The TODO comment is in Chinese; consider using a consistent language (English) for code comments so that all contributors can understand and address it.

Suggested change
// 接收的事件解析出现错误,
// 这应该是预期外的情况,
// 直接终止 session, 但是不终止 Bot,
// 只有当重连次数用尽才考虑终止 Bot。
// TODO 终止session吗?
// An error occurred while parsing the received event,
// which should be an unexpected situation.
// Directly terminate the session, but do not terminate the bot.
// Only consider terminating the bot when the reconnection attempts are exhausted.
// TODO Should the session be terminated?

Copilot uses AI. Check for mistakes.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

就不,中文怎么你了

@ForliyScarlet
Copy link
Member Author

Qodana Community for JVM

2 new problems were found

Inspection name Severity Problems
Unresolved reference in KDoc 🔶 Warning 2

💡 Qodana analysis was run in the pull request mode: only the changed files were checked
☁️ View the detailed Qodana report

Contact Qodana team

Contact us at [email protected]

@ForteScarlet ForteScarlet merged commit ca84aba into master May 19, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants