Skip to content

feat: Android SDK update for version 29.1.0-rc.3 - #139

Merged
ArnabChatterjee20k merged 7 commits into
mainfrom
dev
Oct 7, 2026
Merged

ArnabChatterjee20k merged 7 commits into
mainfrom
dev

Conversation

@ArnabChatterjee20k

@ArnabChatterjee20k ArnabChatterjee20k commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

This PR contains updates to the Android SDK for version 29.1.0-rc.3.

What's Changed

  • Added: first background subscription auto-requests POST_NOTIFICATIONS (Android 13+) from the visible activity
  • Fixed: onOpen/onClose callbacks fire correctly when joining or leaving the background host
  • Fixed: notification taps are recorded after launching the app, so tap-opened screens land on top

Regenerated with sdk-generator 5.5.2.

@hansi-codes

hansi-codes Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

🔵 Tier A · Mergeable after minor fixes

The new permission prompting can duplicate explicit requests, and background connection callbacks still have a deduplication race.

Updates the Android SDK to 29.1.0-rc.3 and expands background push support with foreground-notification controls, permission helpers, refreshed authentication, revised scheduling, and bounded image decoding. Adds notification-tap APIs and an internal tap activity, forwards background connection lifecycle events, and automatically requests notification permission for background subscriptions.

Latest changes: The newest commit bumps the version to rc.3, adds automatic notification-permission prompting, tracks background connection state when joining or leaving the host, and records notification taps after requesting the app launch.

Verdict New comments Fixed Still open
✅ Approved 2 0 1
Finding Where
🟡 Coordinate automatic prompts with explicit permission requests library/src/main/java/io/appwrite/services/Push.kt:997
🟡 Make background connection deduplication atomic library/src/main/java/io/appwrite/services/Push.kt:555
Fix with agent prompt
### Issue 1
library/src/main/java/io/appwrite/services/Push.kt:997-1000
**Coordinate automatic prompts with explicit permission requests**

`requestNotificationPermission()` never updates `asked`, so apps following the existing pattern of requesting permission and then subscribing immediately issue a second request while the first dialog is open; Android rejects overlapping requests and can deliver an empty permission result. If they subscribe after a denial instead, the SDK immediately prompts again—please share request state with the explicit helper.

### Issue 2
library/src/main/java/io/appwrite/services/Push.kt:555-559
**Make background connection deduplication atomic**

When joining a saved connection, `hostInBackground()` can call this on the caller thread while the MQTT connected listener calls it on its own thread. Both can read `backgroundOpen == false` before either writes it, firing `onOpen` twice despite the new deduplication; serialize the state transition and callback dispatch.

### Issue 3
CHANGELOG.md:5
**Describe the push behavior changes in the release notes**

This release changes SDK code substantially, including suppressing foreground notifications by default and adding `notifyInForeground` and background-permission APIs. Saying there are no SDK code changes hides a user-visible behavior change and the option consumers need to restore notifications.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
📂 Walkthrough · 9
File Change
CHANGELOG.md Adds release entries through rc.3 describing push APIs and lifecycle fixes.
README.md Updates dependency versions and documents foreground notifications, background permissions, notification taps, and automatic permission prompting.
library/src/main/AndroidManifest.xml Registers the internal notification-tap activity.
library/src/main/java/io/appwrite/Client.kt Updates the SDK request-header version to 29.1.0-rc.3.
library/src/main/java/io/appwrite/services/Push.kt Adds tap APIs, foreground controls, permission helpers and automatic prompting, cookie authentication fallback, and background lifecycle tracking.
library/src/main/java/io/appwrite/services/PushBackground.kt Reworks authentication, scheduling, acknowledgement draining, image limits, notification filtering and tap intents, and tracks live connection state.
library/src/main/java/io/appwrite/services/PushCore.kt Adds background-status metadata and refreshable MQTT authentication and reconnect handling.
library/src/main/java/io/appwrite/services/PushOpenActivity.kt Launches the app with payload extras before recording and dispatching notification taps.
library/src/main/java/io/appwrite/services/PushWakeups.kt Passes job identity and drain windows to background runs and delegates alarms to expedited jobs.
⏳ Still open from earlier reviews · 1
  • 🟡 Describe the push behavior changes in the release notes · CHANGELOG.md:5

Reviewed the commits since 40fbc3a · Details · Comment @hansi-codes review to re-run, or mention @hansi-codes with a question.

@hansi-codes hansi-codes Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Tier B · 1 blocking finding to address. Summary

Comment thread library/src/main/java/io/appwrite/services/PushBackground.kt Outdated
Comment thread CHANGELOG.md

## 29.1.0-rc.1

* Updated: regenerated with sdk-generator 5.5.0; no SDK code changes

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Describe the push behavior changes in the release notes

This release changes SDK code substantially, including suppressing foreground notifications by default and adding notifyInForeground and background-permission APIs. Saying there are no SDK code changes hides a user-visible behavior change and the option consumers need to restore notifications.

Prompt To Fix With AI
This is a comment left during a code review.
Path: CHANGELOG.md
Line: 5

Comment:
**Describe the push behavior changes in the release notes**

This release changes SDK code substantially, including suppressing foreground notifications by default and adding `notifyInForeground` and background-permission APIs. Saying there are no SDK code changes hides a user-visible behavior change and the option consumers need to restore notifications.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

🟡 Minor · documentation · Reply if this doesn't apply.

@ArnabChatterjee20k ArnabChatterjee20k changed the title feat: Android SDK update for version 29.1.0-rc.1 feat: Android SDK update for version 29.1.0-rc.2 Oct 7, 2026

@hansi-codes hansi-codes Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Tier B · 1 blocking finding to address. Summary

Comment thread library/src/main/java/io/appwrite/services/PushOpenActivity.kt Outdated
Comment thread library/src/main/java/io/appwrite/services/PushBackground.kt
@ArnabChatterjee20k ArnabChatterjee20k changed the title feat: Android SDK update for version 29.1.0-rc.2 feat: Android SDK update for version 29.1.0-rc.3 Oct 7, 2026

@hansi-codes hansi-codes Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Tier A · Looks good to merge. Summary

Comment on lines +997 to +1000
if (asked) {
return
}
asked = true

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coordinate automatic prompts with explicit permission requests

requestNotificationPermission() never updates asked, so apps following the existing pattern of requesting permission and then subscribing immediately issue a second request while the first dialog is open; Android rejects overlapping requests and can deliver an empty permission result. If they subscribe after a denial instead, the SDK immediately prompts again—please share request state with the explicit helper.

Prompt To Fix With AI
This is a comment left during a code review.
Path: library/src/main/java/io/appwrite/services/Push.kt
Line: 997-1000

Comment:
**Coordinate automatic prompts with explicit permission requests**

`requestNotificationPermission()` never updates `asked`, so apps following the existing pattern of requesting permission and then subscribing immediately issue a second request while the first dialog is open; Android rejects overlapping requests and can deliver an empty permission result. If they subscribe after a denial instead, the SDK immediately prompts again—please share request state with the explicit helper.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

🟡 Minor · bug · Reply if this doesn't apply.

Comment on lines +555 to +559
private fun backgroundConnection(open: Boolean) {
if (backgroundOpen == open) {
return
}
backgroundOpen = open

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make background connection deduplication atomic

When joining a saved connection, hostInBackground() can call this on the caller thread while the MQTT connected listener calls it on its own thread. Both can read backgroundOpen == false before either writes it, firing onOpen twice despite the new deduplication; serialize the state transition and callback dispatch.

Prompt To Fix With AI
This is a comment left during a code review.
Path: library/src/main/java/io/appwrite/services/Push.kt
Line: 555-559

Comment:
**Make background connection deduplication atomic**

When joining a saved connection, `hostInBackground()` can call this on the caller thread while the MQTT connected listener calls it on its own thread. Both can read `backgroundOpen == false` before either writes it, firing `onOpen` twice despite the new deduplication; serialize the state transition and callback dispatch.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

🟡 Minor · concurrency · Reply if this doesn't apply.

@ArnabChatterjee20k
ArnabChatterjee20k merged commit 8a921b1 into main Oct 7, 2026
1 check passed
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