Skip to content

fix(mobile): draw generated Bot avatars into Android notification PNGs - #2483

Merged
DoodleBears merged 2 commits into
mainfrom
claude/project-thread-9rg7zp
Oct 21, 2026
Merged

DoodleBears merged 2 commits into
mainfrom
claude/project-thread-9rg7zp

Conversation

@DoodleBears

Copy link
Copy Markdown
Contributor

Requested by Vain · project thread

Why

A phone check of #2465 on Android found that every Bot notification has a blank avatar slot showing only the small app badge. That covers both DMs and approvals. The Channel image displays correctly. The tester narrowed it down: once a Bot is given a PNG avatar with bot-avatar-set, its notification avatar works. Bots on the default generated avatar don't.

Generated avatars reach native-notification-avatars.ts as data:image/svg+xml. On Android, the Image.loadAsync + ImageManipulator path cannot decode SVG into a bitmap, so bot-<slug>.png is never written. ConversationStyle then has no Person/shortcut icon.

Change outline

  • notification-avatars.ts: a generated avatar's AvatarImage also carries the raw svg.
  • The conversation-notifications module adds rasterizeSvgAsync(svg, target, size). It draws the SVG into a 192×192 PNG with androidsvg (the same androidsvg-aar:1.4 expo-image already depends on), writing to a temp file and then renaming it.
  • native-notification-avatars.ts: on Android, SVG avatars go through that function, and everything else keeps the expo-image path. iOS is unchanged.
  • Earlier failed renders were never written to the index, so the next sync renders them again on its own.

Verification

  • tsc passes, and notification-avatars.test.ts passes (7 tests, including the new svg field).
  • CI compiles the Kotlin module.
  • Not yet done: a phone check that a Bot with a generated avatar shows its avatar.

Generated by Claude Code

Generated Bot avatars are SVG, which expo-image cannot load into a bitmap on
Android, so bot-<slug>.png was never written and Bot notifications showed a
blank avatar. The conversation-notifications module now rasterizes the SVG
with androidsvg.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JrtPca5pD72Gdx4CFkQdNi
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JrtPca5pD72Gdx4CFkQdNi
@coderabbitai

coderabbitai Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 73503c45-d61c-4d84-bfdf-a699af7d52d2
📥 Commits

Reviewing files that changed from the base of the PR and between f667ed4 and e2ed11f.

📒 Files selected for processing: 6
  • apps/mobile/modules/conversation-notifications/android/build.gradle
  • apps/mobile/modules/conversation-notifications/android/src/main/java/expo/modules/conversationnotifications/ConversationNotificationsModule.kt
  • apps/mobile/src/host/native-notification-avatars.ts
  • apps/mobile/src/host/notification-avatars.ts
  • apps/mobile/test/notification-avatars.test.ts
  • changes/2483-android-generated-avatar.md
+----------------------------------------------------------------+
| I like what you did here. I don't like *that* you did it here. |
+----------------------------------------------------------------+
  \
   \     /)/)
        ( '')
        /  |
      o(___)
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@DoodleBears
DoodleBears merged commit b485d61 into main Oct 21, 2026
10 of 11 checks passed
DoodleBears added a commit that referenced this pull request Oct 21, 2026
…ground, avatars)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.

2 participants