Skip to content

Fix description silently dropped by encodeDefaults=false#55

Merged
dadachi merged 1 commit into
mainfrom
fix-description-encodedefaults
May 23, 2026
Merged

Fix description silently dropped by encodeDefaults=false#55
dadachi merged 1 commit into
mainfrom
fix-description-encodedefaults

Conversation

@dadachi
Copy link
Copy Markdown
Contributor

@dadachi dadachi commented May 23, 2026

Summary

Mirrors NativeAppTemplate-Android a78f42e.

The Retrofit kotlinx Json config (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. This drops the default — both production call sites (ItemTagCreateViewModel, ItemTagEditViewModel) already pass description explicitly, so the empty string is now always sent.

Note: the upstream commit also fixes DeviceRegistrationBody.platform. That part does not apply here — the Free variant has no device registration.

Changes

  • ItemTagBodyDetail: removed the description default (with explanatory comment)
  • DemoItemTagRepositoryTest: pass description = "" explicitly at both call sites
  • Bumped versionCode 10 → 11, versionName 3.2.5 → 3.2.6
  • Updated CHANGELOG

Testing

  • ./gradlew :app:testDebugUnitTest --tests "...DemoItemTagRepositoryTest"

🤖 Generated with Claude Code

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>
@dadachi dadachi enabled auto-merge (squash) May 23, 2026 22:21
@dadachi dadachi merged commit d1be856 into main May 23, 2026
1 check passed
@dadachi dadachi deleted the fix-description-encodedefaults branch May 23, 2026 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant