[notification] Android: every notification gets an empty InboxStyle, hiding the body
Maintainers usually reply within 3 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 82/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Domain
- backend, mobile-dev
Research direction
Start by tracing how NotificationData.inbox_lines is serialized from Rust and how TauriNotificationManager.buildNotification applies InboxStyle in Kotlin. Compare the two suggested fixes and check the existing notification tests or add a regression case for a title-and-body notification. Done means the expanded Android notification shows its body without requiring large_body.
Written by the indexing model from the issue text.
Description
Describe the bug
On Android, a notification built with only a title and body shows no body text when expanded:
app.notification().builder().title("Claude Bot").body("Hello").show()?;
adb shell dumpsys notification --noredact shows the notification was posted with an empty InboxStyle:
android.title=String (Claude Bot)
android.textLines=CharSequence[] (0)
On Samsung One UI the notification is shown expanded by default, so the message text is never visible.
Cause
NotificationData.inbox_lines is a Vec<String> with #[serde(default)] and no skip_serializing_if, so every notification is sent to Kotlin with "inboxLines": []. Notification.inboxLines is List<String>?, and TauriNotificationManager.buildNotification applies InboxStyle whenever inboxLines != null. An empty list is not null, so every notification without largeBody gets an InboxStyle with zero lines, which replaces the body in the expanded view.
Reproduction
- On Android, show a notification with only
titleandbodyset. - Expand it (or view it on One UI): only the title is visible.
adb shell dumpsys notification --noredactlistsandroid.textLines=CharSequence[] (0).
Expected behavior
The body text is visible in the expanded notification.
Suggested fix
Either #[serde(skip_serializing_if = "Vec::is_empty")] on inbox_lines, or !notification.inboxLines.isNullOrEmpty() in buildNotification.
Workaround: also set large_body to the body text. BigTextStyle is checked before InboxStyle.
Platform and versions
- tauri-plugin-notification 2.3.3; the same code is on the current default branch (2.8.0)
- Android, Samsung One UI
- Dominant language
- Rust
- Stars
- 1.8k
- Forks
- 637
- Avg merge
- 5d 3h
- Merged PRs (30d)
- 36
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from tauri-apps/plugins-workspace
-
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
tauri-apps/plugins-workspace#3780 ·
Maintainers usually reply within 3 days
-
[notification] init script fires IPC on about:blank → 500 'Origin header is not a valid URL' on Linux (WebKitGTK)May be free again A pull request for this issue was closed without being merged. Openplatform: linux plugin: notification type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
tauri-apps/plugins-workspace#3562 · 1 comment ·
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
tauri-apps/plugins-workspace#3543 ·
Maintainers usually reply within 3 days
-
platform: ios plugin: notification type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
tauri-apps/plugins-workspace#3533 ·
Maintainers usually reply within 3 days
-
[bug][notification] Windows: init script always sets `window.Notification.permission` to `"denied"` at startupPossibly taken @Legend-Master claimed this 86 days ago. Openplatform: windows plugin: notification type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
tauri-apps/plugins-workspace#3512 · 1 comment ·
Maintainers usually reply within 3 days
All issues in tauri-apps/plugins-workspace
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
NVIDIA/spark-local-inference#268 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
datafusion-contrib/StreamFusion#653 ·
Maintainers usually reply within 1 day
-
bug CLI exec session
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
tursodatabase/turso#11734 ·
Maintainers usually reply within 1 day