Repository navigation
fix: address review findings on the Apple, Flutter, Node and React Native releases - #1969
Conversation
… in-flight connect
…notification permission
…fore background delivery
🟢 Tier S · Ready to merge
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.
📂 Walkthrough · 19
Reviewed the commits since |
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
close()or dropping the last subscription from a message callback reachesdisconnect().wait()on the MQTT event loopclose()now returns at once. The DISCONNECT and the client shutdown run on a background queue, and the closed client's close listener only reportsonClose.close()whileopen()waits for CONNACK lets the late connection repopulatemqttand the pending subscribe retryclose()bumps the connection epoch and a close generation. The late client is retired, and the pendingsubscribethrowsPush was closed before the subscription was establishedinstead of reopening.size <= chunkSizetakes 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<=.minSdk = 24on every Android appCompletableFutureandOptional(API 24), the same as the Android SDK. The README now says so and showsminSdk = 24next to the desugaring setup.Account result = await avatars.updatePhoto(...)names theAccountservicemodels.dart as modelsand type results asmodels.X, for Dart and Flutter."$id"in a Dart example is interpolatedDart::getParamExampleescapes$in string, object and array examples, giving"\$id".InputFilewithout importing itrequire('node-appwrite/file')instead of the unusedfs.test/client.test.jscovers: a file of exactlyCHUNK_SIZEin one request; a larger file in chunks withcontent-rangeand the shared upload id; a text upload of any size in one request returning text; and a file-less call keeping the response type.POST_NOTIFICATIONSruntime permissionPermissionsAndroidbefore the background example. The Flutter README got the same note.close()during a connect leftsubscribehanging forever: the client's close handler only rejects when the epoch changed.close()now bumps the epoch and a close generation, so the pendingsubscriberejects with the same closed error and doesn't reconnect.Not changed here:
messaging.update*and the OAuth configuration arguments. That comes from the API spec's parameter order, not the templates.Tests
Base.php:Push close while connecting(Apple and React Native) andPush close from callback(Apple: unsubscribing the last handle inside its callback, then subscribing again).tsc.tscpass, and the Apple SDK builds withswift build. The Generation suite, twig lint and Rector pass.dart format(no Dart toolchain here), and the Swift lint (localswift-formatcan't read the repo config).