Skip to content

Commit d1be856

Browse files
dadachiclaude
andauthored
Fix description silently dropped by encodeDefaults=false (#55)
The Retrofit kotlinx Json (NetModule) keeps encodeDefaults=false, so a @serializable request-body property equal to its declared default is omitted from the payload. ItemTagBodyDetail.description = "" (== default) was dropped, so clearing a description on edit was silently ignored by the server's partial update. Drop the default (both call sites already pass description explicitly); update DemoItemTagRepositoryTest to pass description explicitly. Bump versionCode to 11 / versionName to 3.2.6 and update CHANGELOG. Mirrors NativeAppTemplate-Android a78f42e. (The DeviceRegistrationBody fix in that commit does not apply — the Free variant has no device registration.) Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 1976c83 commit d1be856

4 files changed

Lines changed: 14 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
66

7+
## [3.2.6] - 2026-05-24
8+
9+
### Fixed
10+
- Clearing an item tag's description on edit was silently ignored — the Retrofit JSON config keeps `encodeDefaults = false`, so `ItemTagBodyDetail.description = ""` (equal to its declared default) was dropped from the request body and the server's partial update left the old description in place. Removed the default so the empty string is always sent
11+
712
## [3.2.5] - 2026-05-08
813

914
### Changed

app/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ android {
1414
applicationId = "com.nativeapptemplate.nativeapptemplatefree"
1515
targetSdk = 36
1616
minSdk = 26
17-
versionCode = 10
18-
versionName = "3.2.5"
17+
versionCode = 11
18+
versionName = "3.2.6"
1919

2020
vectorDrawables {
2121
useSupportLibrary = true

app/src/test/kotlin/com/nativeapptemplate/nativeapptemplatefree/demo/item_tag/DemoItemTagRepositoryTest.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ class DemoItemTagRepositoryTest {
7171
ItemTagBody(
7272
itemTagBodyDetail = ItemTagBodyDetail(
7373
name = itemTagData.getName(),
74+
description = "",
7475
),
7576
),
7677
).first(),
@@ -86,6 +87,7 @@ class DemoItemTagRepositoryTest {
8687
itemTagBody = ItemTagBody(
8788
itemTagBodyDetail = ItemTagBodyDetail(
8889
name = itemTagData.getName(),
90+
description = "",
8991
),
9092
),
9193
).first(),

model/src/main/kotlin/com/nativeapptemplate/nativeapptemplatefree/model/ItemTagBodyDetail.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,9 @@ import kotlinx.serialization.Serializable
88
@Parcelize
99
data class ItemTagBodyDetail(
1010
val name: String,
11-
val description: String = "",
11+
// No default: with the Json config's encodeDefaults = false, a value equal to
12+
// its default ("") is dropped from the payload, so clearing a description on
13+
// edit would be silently ignored by the server's partial update. Both call
14+
// sites supply description explicitly.
15+
val description: String,
1216
) : Parcelable

0 commit comments

Comments
 (0)