Skip to content

Commit d978a20

Browse files
committed
Merge branch 'revive-2026-07'
2 parents 383c426 + af10d8c commit d978a20

4 files changed

Lines changed: 17 additions & 11 deletions

File tree

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version=1.0.0-SNAPSHOT
1+
version=1.0.1-SNAPSHOT
22
org.gradle.jvmargs=-Xmx1024M
33
kapt.use.k2=true
44
org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled

vertigram-core/src/main/kotlin/ski/gagar/vertigram/Vertigram.kt

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,14 +218,17 @@ class Vertigram(
218218
return raw.consumer(vertigramAddress(address).address) { msg: Message<JsonObject> ->
219219
coroScope.launch(MDCContext(coroScope.coroMdcWith(CONSUMER_ADDRESS_MDC to vertigramAddress(address).address))) {
220220
val reqW: Request<RequestPayload> = msg.body()!!.mapTo(reqWrapperType, objectMapper)
221-
222221
try {
223222
msg.replyWithSuccess(function(reqW.payload), this@Vertigram, replyOptions)
224223
} catch (t: Throwable) {
225224
msg.replyWithThrowable<RequestPayload>(t, this@Vertigram, replyOptions)
226225
when (t) {
227226
is VertigramInternalException -> throw t
228-
is VertigramException -> {}
227+
is VertigramException -> {
228+
if (null == msg.replyAddress()) {
229+
throw t
230+
}
231+
}
229232
else -> throw t
230233
}
231234
}
@@ -257,14 +260,17 @@ class Vertigram(
257260
return raw.localConsumer(vertigramAddress(address).address) { msg: Message<JsonObject> ->
258261
coroScope.launch(MDCContext(coroScope.coroMdcWith(CONSUMER_ADDRESS_MDC to vertigramAddress(address).address))) {
259262
val reqW: Request<RequestPayload> = msg.body()!!.mapTo(reqWrapperType, objectMapper)
260-
261263
try {
262264
msg.replyWithSuccess(function(reqW.payload), this@Vertigram, replyOptions)
263265
} catch (t: Throwable) {
264266
msg.replyWithThrowable<RequestPayload>(t, this@Vertigram, replyOptions)
265267
when (t) {
266268
is VertigramInternalException -> throw t
267-
is VertigramException -> {}
269+
is VertigramException -> {
270+
if (null == msg.replyAddress()) {
271+
throw t
272+
}
273+
}
268274
else -> throw t
269275
}
270276
}

vertigram-telegram-client/src/main/kotlin/ski/gagar/vertigram/telegram/types/richmessage/RichMessage.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ data class ListItem internal constructor(
313313
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", include = JsonTypeInfo.As.EXISTING_PROPERTY)
314314
@JsonSubTypes(
315315
JsonSubTypes.Type(value = Block.Paragraph::class, name = Block.Type.PARAGRAPH_STR),
316-
JsonSubTypes.Type(value = Block.SectionHeading::class, name = Block.Type.SECTION_HEADING_STR),
316+
JsonSubTypes.Type(value = Block.SectionHeading::class, name = Block.Type.HEADING_STR),
317317
JsonSubTypes.Type(value = Block.Preformatted::class, name = Block.Type.PRE_STR),
318318
JsonSubTypes.Type(value = Block.Footer::class, name = Block.Type.FOOTER_STR),
319319
JsonSubTypes.Type(value = Block.Divider::class, name = Block.Type.DIVIDER_STR),
@@ -340,8 +340,8 @@ sealed interface Block {
340340
@TelegramCodegen.Type
341341
data class Paragraph internal constructor(val text: RichTextValue) : Block { override val type = Type.PARAGRAPH; companion object }
342342
@TelegramCodegen.Type
343-
data class SectionHeading internal constructor(val text: RichTextValue, val level: Int) : Block {
344-
override val type = Type.SECTION_HEADING
343+
data class SectionHeading internal constructor(val text: RichTextValue, val size: Int) : Block {
344+
override val type = Type.HEADING
345345
companion object
346346
}
347347
@TelegramCodegen.Type
@@ -444,7 +444,7 @@ sealed interface Block {
444444

445445
enum class Type {
446446
@JsonProperty(PARAGRAPH_STR) PARAGRAPH,
447-
@JsonProperty(SECTION_HEADING_STR) SECTION_HEADING,
447+
@JsonProperty(HEADING_STR) HEADING,
448448
@JsonProperty(PRE_STR) PRE,
449449
@JsonProperty(FOOTER_STR) FOOTER,
450450
@JsonProperty(DIVIDER_STR) DIVIDER,
@@ -467,7 +467,7 @@ sealed interface Block {
467467

468468
companion object {
469469
const val PARAGRAPH_STR = "paragraph"
470-
const val SECTION_HEADING_STR = "section_heading"
470+
const val HEADING_STR = "heading"
471471
const val PRE_STR = "pre"
472472
const val FOOTER_STR = "footer"
473473
const val DIVIDER_STR = "divider"

vertigram-telegram-client/src/test/kotlin/ski/gagar/vertigram/telegram/types/richmessage/RichMessageSerializationTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ object RichMessageSerializationTest : BaseSerializationTest() {
7171
val photo = PhotoSize(fileId = "photo", fileUniqueId = "unique-photo", width = 1, height = 1)
7272

7373
assertSerializable<Block>(paragraph)
74-
assertSerializable<Block>(Block.SectionHeading(text = RichTextValue.plain("heading"), level = 2))
74+
assertSerializable<Block>(Block.SectionHeading(text = RichTextValue.plain("heading"), size = 2))
7575
assertSerializable<Block>(Block.Preformatted(text = text, language = "kotlin"))
7676
assertSerializable<Block>(Block.Footer(text = text))
7777
assertSerializable<Block>(Block.Divider)

0 commit comments

Comments
 (0)