Skip to content

fix: address review findings on the Apple, Flutter, Node and React Native releases - #1969

Merged
ArnabChatterjee20k merged 13 commits into
mainfrom
fix/sdk-release-review
Oct 6, 2026
Merged

ArnabChatterjee20k merged 13 commits into
mainfrom
fix/sdk-release-review

Conversation

@ArnabChatterjee20k

Copy link
Copy Markdown
Member

What

Generator fixes for the review findings on the SDK release PRs:

Each fix is in the templates, so it reaches every SDK that shares them.

Findings and fixes

SDK PR Finding Fix
Apple #125 Calling close() or dropping the last subscription from a message callback reaches disconnect().wait() on the MQTT event loop close() now returns at once. The DISCONNECT and the client shutdown run on a background queue, and the closed client's close listener only reports onClose.
Apple #125 close() while open() waits for CONNACK lets the late connection repopulate mqtt and the pending subscribe retry close() bumps the connection epoch and a close generation. The late client is retired, and the pending subscribe throws Push was closed before the subscription was established instead of reopening.
Apple #125 A photo of exactly 5 MiB enters the chunk protocol size <= chunkSize takes the single-request path. The same off-by-one is fixed in Swift, Kotlin, Android, .NET, Unity, Python and Ruby; Node, Web, Dart, Go, PHP and Rust already used <=.
Apple #125 Request a nonzero MQTT session expiry for offline delivery Not changed. The Appwrite broker replays from a server-side cursor keyed on the user and client id, not from MQTT session state, which is why no SDK sets a session expiry.
Flutter #333 Registering the plugin forces minSdk = 24 on every Android app Kept at 24: Push's MQTT client needs CompletableFuture and Optional (API 24), the same as the Android SDK. The README now says so and shows minSdk = 24 next to the desugaring setup.
Flutter #333 Account result = await avatars.updatePhoto(...) names the Account service Examples import models.dart as models and type results as models.X, for Dart and Flutter.
Flutter #333 "$id" in a Dart example is interpolated Dart::getParamExample escapes $ in string, object and array examples, giving "\$id".
Node #169 The upload example uses InputFile without importing it Multipart examples require('node-appwrite/file') instead of the unused fs.
Node #169 No client tests for the upload branches test/client.test.js covers: a file of exactly CHUNK_SIZE in one request; a larger file in chunks with content-range and the shared upload id; a text upload of any size in one request returning text; and a file-less call keeping the response type.
React Native #119 Android 13+ needs the POST_NOTIFICATIONS runtime permission The README requests it with PermissionsAndroid before the background example. The Flutter README got the same note.
React Native #119 (filtered) Invalidate pending subscriptions when closing Push Before this, close() during a connect left subscribe hanging forever: the client's close handler only rejects when the epoch changed. close() now bumps the epoch and a close generation, so the pending subscribe rejects with the same closed error and doesn't reconnect.

Not changed here:

Tests

  • New e2e lines in Base.php: Push close while connecting (Apple and React Native) and Push close from callback (Apple: unsubscribing the last handle inside its callback, then subscribing again).
  • Node: 4 new client tests. The full suite passes (912 tests), along with format, lint and tsc.
  • Locally: React Native format, lint and tsc pass, and the Apple SDK builds with swift build. The Generation suite, twig lint and Rector pass.
  • Left to CI: Dart and Flutter compile and dart format (no Dart toolchain here), and the Swift lint (local swift-format can't read the repo config).

@hansi-codes

hansi-codes Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

🟢 Tier S · Ready to merge

No concrete defects were found in the new changes after checking the surrounding Push lifecycle code, upload APIs, and mock-server response handling.

Fixes shared upload templates so files exactly at the chunk-size limit use a single request, and improves Apple and React Native Push shutdown handling. It also corrects generated Dart/Flutter and Node examples, documents Android notification requirements, and adds upload and Push lifecycle regression coverage.

Latest changes: The newest commits add cross-language 5 MiB upload boundary tests with mock-server validation, and guard React Native subscriptions against close() during asynchronous setup with an immediate-close regression test.

Verdict New comments Fixed Still open
✅ Approved 0 0 0
📂 Walkthrough · 19
File Change
src/SDK/Language/Dart.php Escapes dollar interpolation in generated string, object, and array examples.
templates/android/library/src/main/java/io/package/Client.kt.twig, templates/kotlin/src/main/kotlin/io/appwrite/Client.kt.twig Includes exactly chunk-sized files in the single-request upload path.
templates/apple/Sources/Client.swift.twig, templates/swift/Sources/Client.swift.twig Corrects the single-request upload size boundary.
templates/dotnet/Package/Client.cs.twig, templates/unity/Assets/Runtime/Core/Client.cs.twig Corrects the single-request upload size boundary.
templates/python/package/client.py.twig, templates/ruby/lib/container/client.rb.twig Corrects the single-request upload size boundary.
templates/apple/Sources/Services/Push.swift.twig Moves shutdown off the callback event loop and invalidates pending connections on close.
templates/dart/docs/example.md.twig, templates/flutter/docs/example.md.twig Qualifies result models through an aliased models import.
templates/flutter/README.md.twig Documents the API 24 minimum and Android notification permission requirements.
templates/node/docs/example.md.twig Imports InputFile for multipart examples.
templates/node/test/client.test.js.twig Adds upload boundary, chunking, text-response, and file-less call tests.
templates/react-native/README.md.twig Shows requesting notification permission on Android 13 and later.
templates/react-native/src/services/push.ts.twig Invalidates pending subscriptions on close and checks close generation after asynchronous setup.
mock-server/app/http.php Rejects chunk-protocol requests for exactly 5 MiB files and validates boundary fixtures.
tests/e2e/Base.php Defines expected output for boundary uploads and Push shutdown regression scenarios.
tests/e2e/Android16Java17Test.php, tests/e2e/Android5Java17Test.php, tests/e2e/AppleSwift61Test.php, tests/e2e/DotNet60Test.php, tests/e2e/DotNet80Test.php, tests/e2e/DotNet90Test.php, tests/e2e/KotlinJava17Test.php, tests/e2e/Python310Test.php, tests/e2e/Python311Test.php, tests/e2e/Python312Test.php, tests/e2e/Python313Test.php, tests/e2e/Python39Test.php, tests/e2e/Ruby27Test.php, tests/e2e/Ruby30Test.php, tests/e2e/Ruby31Test.php, tests/e2e/Swift61Test.php, tests/e2e/Unity2021Test.php Registers boundary-upload expectations; Apple also registers Push shutdown expectations.
tests/e2e/ReactNativeAndroidTest.php Registers close-while-connecting and immediate-close Push expectations.
tests/e2e/languages/android/Tests.kt, tests/e2e/languages/kotlin/Tests.kt, tests/e2e/languages/dotnet/Tests.cs, tests/e2e/languages/python/tests.py, tests/e2e/languages/ruby/tests.rb, tests/e2e/languages/swift/Tests.swift, tests/e2e/languages/unity/Tests.cs Exercises exactly 5 MiB uploads using in-memory input files.
tests/e2e/languages/apple/Tests.swift Tests boundary uploads, closing during connection, and unsubscribing from a message callback.
tests/e2e/languages/react-native/push.node.js Tests subscription rejection when closing during connection or immediately after subscribe.

Reviewed the commits since b657b7b · 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 templates/react-native/src/services/push.ts.twig
Comment thread templates/apple/Sources/Client.swift.twig

@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 S · Looks good to merge. Summary

@ArnabChatterjee20k
ArnabChatterjee20k merged commit 0765593 into main Oct 6, 2026
61 checks 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