Skip to content

feat: Android SDK update for version 13.0.0#115

Open
ChiragAgg5k wants to merge 3 commits intomainfrom
dev
Open

feat: Android SDK update for version 13.0.0#115
ChiragAgg5k wants to merge 3 commits intomainfrom
dev

Conversation

@ChiragAgg5k
Copy link
Member

@ChiragAgg5k ChiragAgg5k commented Mar 24, 2026

This PR contains updates to the Android SDK for version 13.0.0.

* Added Java `DocumentsDB` CRUD operation examples in docs
* Updated server compatibility note to Appwrite server version 1.8.x
* Updated Gradle/Maven dependencies to `12.1.0`
* Updated API version badge to `1.9.0` in README
@coderabbitai
Copy link

coderabbitai bot commented Mar 24, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ea95d7f6-6630-41dd-8dba-1378b5edff78

📥 Commits

Reviewing files that changed from the base of the PR and between 0ad33c7 and b199e60.

📒 Files selected for processing (3)
  • CHANGELOG.md
  • README.md
  • library/src/main/java/io/appwrite/Client.kt
✅ Files skipped from review due to trivial changes (1)
  • README.md
🚧 Files skipped from review as they are similar to previous changes (2)
  • CHANGELOG.md
  • library/src/main/java/io/appwrite/Client.kt

Walkthrough

This pull request updates the Appwrite Kotlin client library to version 1.9.0 compatibility. Changes include updating the default response format header from version 1.8.0 to 1.9.0, adding three new Client fluent methods for impersonation configuration (setImpersonateUserId, setImpersonateUserEmail, setImpersonateUserPhone), changing the sequence field type from Long to String in both Document and Row models, adding two new optional fields to the User model for impersonation tracking, introducing deprecated upsertDocuments API methods in the Databases service, and adding documentation examples for the new methods.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: updating the Android SDK to version 13.0.0, which is confirmed by CHANGELOG.md updates, version badge changes, and model/API modifications throughout the changeset.
Docstring Coverage ✅ Passed Docstring coverage is 87.04% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev

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 and usage tips.

@greptile-apps
Copy link

greptile-apps bot commented Mar 24, 2026

Greptile Summary

This PR downgrades the Android SDK from version 13.0.0 to 12.1.1, adds new DocumentsDB and VectorsDB service classes, introduces user-impersonation support in Client.kt and User.kt, and ships Java + Kotlin documentation examples for the new services. Several issues need attention before merging:

  • CHANGELOG version mismatch: The changelog entry says "Updated Gradle/Maven dependencies to 12.1.0" but the shipped version is 12.1.1.
  • Broken @Deprecated replaceWith: Databases.upsertDocuments points users to TablesDB.upsertRows, but that method does not exist; the correct name is upsertRow (singular).
  • Java doc example compile errors — Long? parameters: The Java examples for createTransaction and listDocuments (in both documentsdb and vectorsdb) pass bare integer literals (60, 0) for Long? parameters. Java cannot widen and box in a single step, so these examples will not compile. The ttl argument must be written as 60L / 0L.
  • Java doc example compile errors — Double? parameters: The Java examples for decrementDocumentAttribute and incrementDocumentAttribute pass integer 0 for Double? parameters (value, min, max). Same widening-plus-boxing restriction applies; 0.0 or 0d should be used instead.
  • x-appwrite-response-format vs stated server compatibility: Client.kt sends x-appwrite-response-format: 1.9.0 while the README declares compatibility with Appwrite server 1.8.x. If the server at 1.8.x does not recognise format 1.9.0, all requests will fail against the stated compatible server.

Confidence Score: 2/5

  • Not safe to merge — multiple Java documentation examples will not compile, a deprecated method points to a non-existent replacement, and there is a server-compatibility version conflict.
  • Several concrete bugs are present: broken @Deprecated replaceWith reference, multiple Java doc examples with type errors that prevent compilation, a CHANGELOG version inconsistency, and a mismatch between the stated Appwrite server compatibility (1.8.x) and the x-appwrite-response-format header (1.9.0) sent in every API request.
  • library/src/main/java/io/appwrite/services/Databases.kt (broken deprecation), library/src/main/java/io/appwrite/Client.kt (response-format vs server-compat mismatch), all Java doc examples under docs/examples/java/documentsdb/ and docs/examples/java/vectorsdb/ that use numeric literals for Long? or Double? parameters.

Important Files Changed

Filename Overview
CHANGELOG.md CHANGELOG entry erroneously says "Updated Gradle/Maven dependencies to 12.1.0" while the actual version shipped is 12.1.1.
README.md API version badge updated to 1.9.0, dependency versions corrected to 12.1.1, and server compatibility note updated to 1.8.x; however the compatibility note conflicts with the 1.9.0 response-format header sent in Client.kt.
library/src/main/java/io/appwrite/Client.kt Adds three impersonation setter methods; downgrades x-sdk-version to 12.1.1 but bumps x-appwrite-response-format to 1.9.0, which conflicts with the stated server compatibility of 1.8.x in the README.
library/src/main/java/io/appwrite/services/Databases.kt Adds deprecated upsertDocuments method; the @Deprecated replaceWith references TablesDB.upsertRows which does not exist (the actual method is upsertRow, singular).
library/src/main/java/io/appwrite/services/DocumentsDB.kt New service with full CRUD, transaction, increment/decrement, and upsert operations; service-level KDoc body is empty but code structure matches patterns used by existing services.
library/src/main/java/io/appwrite/services/VectorsDB.kt New service mirroring DocumentsDB but for vectors; structurally consistent, same empty class-level KDoc issue, no functional defects beyond what is shared with DocumentsDB.
library/src/main/java/io/appwrite/models/Document.kt Type of sequence changed from Long to String; this is a potential breaking change for callers comparing or arithmetic-using the sequence value.
library/src/main/java/io/appwrite/models/User.kt Adds two nullable impersonation fields (impersonator, impersonatorUserId) with proper nullable deserialization; no issues found.
docs/examples/java/documentsdb/create-transaction.md Java example passes 60 (int literal) for a Long? (java.lang.Long) parameter — this will not compile in Java due to the widening-plus-boxing restriction.
docs/examples/java/documentsdb/decrement-document-attribute.md Java example passes integer 0 for both value: Double? and min: Double? parameters — will not compile in Java for the same widening-plus-boxing reason.
docs/examples/java/documentsdb/list-documents.md Java example passes 0 (int literal) for ttl: Long? parameter — will not compile in Java.

Comments Outside Diff (3)

  1. CHANGELOG.md, line 15-18 (link)

    P1 CHANGELOG dependency version inconsistency

    The CHANGELOG entry says "Updated Gradle/Maven dependencies to 12.1.0", but the README, the PR title, and the SDK version header all use 12.1.1. This creates a misleading history for anyone reading the changelog.

  2. library/src/main/java/io/appwrite/services/Databases.kt, line 1950-1953 (link)

    P1 Deprecated replaceWith references a non-existent method

    The @Deprecated annotation says to use TablesDB.upsertRows, but TablesDB only has upsertRow (singular) — there is no upsertRows method in TablesDB.kt. The replaceWith reference is therefore broken and will mislead any IDE or developer following the deprecation guidance.

    The deprecation message and replaceWith also appear on both overloads of upsertDocuments (the generic and the non-generic form). Both need to be corrected.

  3. library/src/main/java/io/appwrite/Client.kt, line 1726-1727 (link)

    P1 x-appwrite-response-format version conflicts with stated server compatibility

    x-appwrite-response-format is set to 1.9.0, but the README now says this SDK is "compatible with Appwrite server version 1.8.x". If the Appwrite 1.8.x server does not recognise response-format 1.9.0, all API calls from this SDK will fail or return unexpected responses against the stated compatible server.

    Either the README compatibility note should reflect 1.9.x, or the response-format header should be rolled back to match 1.8.x.

Reviews (1): Last reviewed commit: "feat: update Android SDK to 12.1.1" | Re-trigger Greptile

Comment on lines +13 to +14
60, // ttl (optional)
new CoroutineCallback<>((result, error) -> {
Copy link

Choose a reason for hiding this comment

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

P1 int literal passed for Long? parameter — Java compile error

The ttl parameter in createTransaction has type Long? in Kotlin, which compiles to java.lang.Long on the JVM. In Java, the literal 60 has type int. Java does not allow combining widening conversion (intlong) with boxing (longLong) in a single method-invocation step, so this example will not compile.

The same problem exists in docs/examples/java/vectorsdb/create-transaction.md (line 13) and in docs/examples/java/documentsdb/list-documents.md and docs/examples/java/vectorsdb/list-documents.md where ttl = 0 is passed.

Suggested change
60, // ttl (optional)
new CoroutineCallback<>((result, error) -> {
60L, // ttl (optional)

Comment on lines +17 to +18
0, // value (optional)
0, // min (optional)
Copy link

Choose a reason for hiding this comment

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

P1 int literals passed for Double? parameters — Java compile error

The value and min parameters of decrementDocumentAttribute have type Double? in Kotlin (compiled to java.lang.Double on the JVM). Java does not allow combining widening (intdouble) and boxing (doubleDouble) in a single method invocation, so passing the integer literals 0 here will not compile.

The identical issue exists in docs/examples/java/documentsdb/increment-document-attribute.md for the value and max parameters.

Suggested change
0, // value (optional)
0, // min (optional)
0.0, // value (optional)
0.0, // min (optional)

Comment on lines +17 to +18
false, // total (optional)
0, // ttl (optional)
Copy link

Choose a reason for hiding this comment

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

P1 int literal passed for Long? parameter — Java compile error

ttl has type Long? in Kotlin (i.e., java.lang.Long from Java). Passing 0 (an int literal) is a compile error for the same widening+boxing reason described in create-transaction.md.

The same issue exists in docs/examples/java/vectorsdb/list-documents.md.

Suggested change
false, // total (optional)
0, // ttl (optional)
false, // total (optional)
0L, // ttl (optional)

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 13

Note

Due to the large number of review comments, Critical, Major severity comments were prioritized as inline comments.

🟡 Minor comments (21)
docs/examples/java/documentsdb/delete-document.md-2-4 (1)

2-4: ⚠️ Potential issue | 🟡 Minor

Add missing Log import in the Java example.

Line 23 uses Log.d(), but android.util.Log is not imported.

Proposed documentation fix
 import io.appwrite.Client;
 import io.appwrite.coroutines.CoroutineCallback;
 import io.appwrite.services.DocumentsDB;
+import android.util.Log;
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/examples/java/documentsdb/delete-document.md` around lines 2 - 4, The
Java example is missing the android.util.Log import used by Log.d(); add the
import statement for android.util.Log alongside the existing imports (Client,
CoroutineCallback, DocumentsDB) so Log.d(...) resolves correctly and the example
compiles and runs.
docs/examples/java/vectorsdb/delete-transaction.md-1-24 (1)

1-24: ⚠️ Potential issue | 🟡 Minor

Missing import for android.util.Log.

The example uses Log.d on line 20 but doesn't import android.util.Log. This will cause a compilation error when users copy this example.

📝 Proposed fix to add the missing import
 ```java
 import io.appwrite.Client;
 import io.appwrite.coroutines.CoroutineCallback;
 import io.appwrite.services.VectorsDB;
+import android.util.Log;

 Client client = new Client(context)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/examples/java/vectorsdb/delete-transaction.md` around lines 1 - 24, The
example is missing the android.util.Log import used by Log.d in the
vectorsDB.deleteTransaction callback; add the import statement for
android.util.Log at the top of the snippet so that Log.d(...) compiles and the
example with VectorsDB.deleteTransaction and CoroutineCallback compiles
correctly.
docs/examples/java/documentsdb/list-transactions.md-1-24 (1)

1-24: ⚠️ Potential issue | 🟡 Minor

Missing import for android.util.Log.

The example uses Log.d on line 20 but doesn't import android.util.Log. This will cause a compilation error when users copy this example.

📝 Proposed fix to add the missing import
 ```java
 import io.appwrite.Client;
 import io.appwrite.coroutines.CoroutineCallback;
 import io.appwrite.services.DocumentsDB;
+import android.util.Log;

 Client client = new Client(context)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/examples/java/documentsdb/list-transactions.md` around lines 1 - 24, The
example is missing the android.util.Log import used by Log.d in the
DocumentsDB.listTransactions callback; add the import statement for
android.util.Log at the top of the file so Log.d resolves correctly and the
snippet compiles, keeping the rest of the example (Client, DocumentsDB, and the
listTransactions call with CoroutineCallback) unchanged.
docs/examples/java/documentsdb/list-documents.md-1-29 (1)

1-29: ⚠️ Potential issue | 🟡 Minor

Missing import for android.util.Log.

The example uses Log.d on line 25 but doesn't import android.util.Log. This will cause a compilation error when users copy this example.

📝 Proposed fix to add the missing import
 ```java
 import io.appwrite.Client;
 import io.appwrite.coroutines.CoroutineCallback;
 import io.appwrite.services.DocumentsDB;
+import android.util.Log;

 Client client = new Client(context)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/examples/java/documentsdb/list-documents.md` around lines 1 - 29, The
example is missing the android.util.Log import used by Log.d, causing a compile
error; add the import for android.util.Log at the top of the snippet so the use
of Log.d in the DocumentsDB.listDocuments callback resolves correctly and the
example compiles as-is.
docs/examples/java/documentsdb/create-transaction.md-1-24 (1)

1-24: ⚠️ Potential issue | 🟡 Minor

Missing import for android.util.Log.

The example uses Log.d on line 20 but doesn't import android.util.Log. This will cause a compilation error when users copy this example.

📝 Proposed fix to add the missing import
 ```java
 import io.appwrite.Client;
 import io.appwrite.coroutines.CoroutineCallback;
 import io.appwrite.services.DocumentsDB;
+import android.util.Log;

 Client client = new Client(context)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/examples/java/documentsdb/create-transaction.md` around lines 1 - 24,
The example uses android.util.Log (Log.d) but the import is missing, causing a
compile error; add the import statement for android.util.Log at the top of the
snippet so the Log.d call in the DocumentsDB.createTransaction callback resolves
correctly (ensure the import appears alongside the existing imports for Client,
CoroutineCallback, and DocumentsDB).
docs/examples/java/documentsdb/upsert-document.md-1-31 (1)

1-31: ⚠️ Potential issue | 🟡 Minor

Missing android.util.Log import.

The example uses Log.d at line 27 but doesn't import android.util.Log. Adding this import would make the example immediately compilable.

📦 Proposed fix to add missing import
 ```java
 import io.appwrite.Client;
 import io.appwrite.coroutines.CoroutineCallback;
 import io.appwrite.Permission;
 import io.appwrite.Role;
 import io.appwrite.services.DocumentsDB;
+import android.util.Log;

 Client client = new Client(context)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/examples/java/documentsdb/upsert-document.md` around lines 1 - 31, Add
the missing Android Log import so the example compiles: include the
android.util.Log import at the top of the sample used with Log.d in the
upsertDocument CoroutineCallback; ensure the import appears alongside the other
imports (e.g., near io.appwrite.Client,
io.appwrite.coroutines.CoroutineCallback, etc.) so Log.d resolves correctly.
docs/examples/java/documentsdb/delete-transaction.md-1-24 (1)

1-24: ⚠️ Potential issue | 🟡 Minor

Missing android.util.Log import.

The example uses Log.d at line 20 but doesn't import android.util.Log. Adding this import would make the example immediately compilable.

📦 Proposed fix to add missing import
 ```java
 import io.appwrite.Client;
 import io.appwrite.coroutines.CoroutineCallback;
 import io.appwrite.services.DocumentsDB;
+import android.util.Log;

 Client client = new Client(context)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/examples/java/documentsdb/delete-transaction.md` around lines 1 - 24,
The example is missing the android.util.Log import used by Log.d in the
DocumentsDB.deleteTransaction callback; update the example header imports to
include android.util.Log so the Log.d call compiles (add the import alongside
Client, CoroutineCallback, and DocumentsDB at the top of the snippet).
docs/examples/java/documentsdb/update-document.md-1-31 (1)

1-31: ⚠️ Potential issue | 🟡 Minor

Missing android.util.Log import.

The example uses Log.d at line 27 but doesn't import android.util.Log. While this is a documentation example, including the correct import would make it immediately compilable for users who copy-paste the code.

📦 Proposed fix to add missing import
 ```java
 import io.appwrite.Client;
 import io.appwrite.coroutines.CoroutineCallback;
 import io.appwrite.Permission;
 import io.appwrite.Role;
 import io.appwrite.services.DocumentsDB;
+import android.util.Log;

 Client client = new Client(context)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/examples/java/documentsdb/update-document.md` around lines 1 - 31, Add
the missing android.util.Log import so the example that calls Log.d compiles;
update the top of the snippet where imports are declared (near Client,
CoroutineCallback, Permission, Role, DocumentsDB) to include import
android.util.Log; no other code changes to DocumentsDB or updateDocument are
needed.
docs/examples/java/documentsdb/increment-document-attribute.md-1-30 (1)

1-30: ⚠️ Potential issue | 🟡 Minor

Missing android.util.Log import.

The example uses Log.d at line 26 but doesn't import android.util.Log. Adding this import would make the example immediately compilable.

📦 Proposed fix to add missing import
 ```java
 import io.appwrite.Client;
 import io.appwrite.coroutines.CoroutineCallback;
 import io.appwrite.services.DocumentsDB;
+import android.util.Log;

 Client client = new Client(context)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/examples/java/documentsdb/increment-document-attribute.md` around lines
1 - 30, The example fails to compile because android.util.Log is not imported;
add the import statement for android.util.Log at the top of the file so the
Log.d call in the DocumentsDB.incrementDocumentAttribute callback resolves.
Locate the example using DocumentsDB.incrementDocumentAttribute (and the Log.d
usage) and insert the missing import for android.util.Log alongside the other
imports.
docs/examples/java/vectorsdb/create-operations.md-2-4 (1)

2-4: ⚠️ Potential issue | 🟡 Minor

Add missing Java/Android imports used by the snippet.

The example uses List, Map, and Log but doesn’t import them.

Proposed fix
 import io.appwrite.Client;
 import io.appwrite.coroutines.CoroutineCallback;
 import io.appwrite.services.VectorsDB;
+import android.util.Log;
+import java.util.List;
+import java.util.Map;

Also applies to: 14-20, 29-29

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/examples/java/vectorsdb/create-operations.md` around lines 2 - 4, The
snippet is missing imports for types used (List, Map) and the logger (Log); add
the appropriate import lines at the top along with the existing
imports—specifically import java.util.List; import java.util.Map; and import
android.util.Log;—so occurrences of List, Map and Log referenced alongside
Client and VectorsDB compile correctly in the example.
docs/examples/java/vectorsdb/create-transaction.md-2-5 (1)

2-5: ⚠️ Potential issue | 🟡 Minor

Import android.util.Log for the logging line.

Line 20 uses Log.d(...) without importing Log.

Proposed fix
 import io.appwrite.Client;
 import io.appwrite.coroutines.CoroutineCallback;
 import io.appwrite.services.VectorsDB;
+import android.util.Log;

Also applies to: 20-20

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/examples/java/vectorsdb/create-transaction.md` around lines 2 - 5, The
example is missing the Android Log import used on line with Log.d(...); add the
import statement for android.util.Log alongside the existing imports (next to
io.appwrite.Client, io.appwrite.coroutines.CoroutineCallback,
io.appwrite.services.VectorsDB) so the Log.d(...) call resolves correctly.
docs/examples/java/vectorsdb/list-documents.md-2-4 (1)

2-4: ⚠️ Potential issue | 🟡 Minor

Import List and Log used by the example code.

The snippet currently omits required imports for List.of() and Log.d().

Proposed fix
 import io.appwrite.Client;
 import io.appwrite.coroutines.CoroutineCallback;
 import io.appwrite.services.VectorsDB;
+import android.util.Log;
+import java.util.List;

Also applies to: 15-15, 25-25

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/examples/java/vectorsdb/list-documents.md` around lines 2 - 4, The
example is missing imports for the symbols used: add an import for
java.util.List to support List.of() and an import for android.util.Log to
support Log.d(); update the top imports in the file that currently include
Client, CoroutineCallback, and VectorsDB so the example compiles and references
to List.of() and Log.d() resolve (also ensure the same imports are present for
the other occurrences noted around the other example blocks).
docs/examples/java/vectorsdb/update-document.md-2-7 (1)

2-7: ⚠️ Potential issue | 🟡 Minor

Add missing imports so the Java example compiles as-is.

This snippet uses Map, List, and Log but does not import them.

Proposed fix
 import io.appwrite.Client;
 import io.appwrite.coroutines.CoroutineCallback;
 import io.appwrite.Permission;
 import io.appwrite.Role;
 import io.appwrite.services.VectorsDB;
+import android.util.Log;
+import java.util.List;
+import java.util.Map;

Also applies to: 18-20, 27-27

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/examples/java/vectorsdb/update-document.md` around lines 2 - 7, The
example is missing imports for types used in the snippet; add the appropriate
imports for java.util.Map and java.util.List and the logging class used (e.g.,
android.util.Log or java.util.logging.Logger depending on the example) so the
sample compiles as-is; update the top import block alongside existing imports
(near VectorsDB/CoroutineCallback usages) to include Map, List, and Log.
docs/examples/java/documentsdb/create-documents.md-2-4 (1)

2-4: ⚠️ Potential issue | 🟡 Minor

Add missing imports required by List.of and Log.d.

The snippet won’t compile as pasted without these imports.

Proposed fix
 import io.appwrite.Client;
 import io.appwrite.coroutines.CoroutineCallback;
 import io.appwrite.services.DocumentsDB;
+import android.util.Log;
+import java.util.List;

Also applies to: 15-15, 22-22

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/examples/java/documentsdb/create-documents.md` around lines 2 - 4, The
snippet is missing imports for List.of and Log.d; add the appropriate imports
(e.g., import java.util.List; and import android.util.Log;) alongside the
existing imports (Client, CoroutineCallback, DocumentsDB) so that usages of
List.of and Log.d compile; update the top-of-file import block where imports are
declared to include these two imports.
docs/examples/java/vectorsdb/update-transaction.md-2-4 (1)

2-4: ⚠️ Potential issue | 🟡 Minor

Missing Log import in this Java snippet.

Line 22 references Log.d(...) but android.util.Log is not imported.

Proposed fix
 import io.appwrite.Client;
 import io.appwrite.coroutines.CoroutineCallback;
 import io.appwrite.services.VectorsDB;
+import android.util.Log;

Also applies to: 22-22

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/examples/java/vectorsdb/update-transaction.md` around lines 2 - 4, The
snippet uses Log.d(...) but misses the android.util.Log import; add the import
statement for android.util.Log to the top imports alongside Client,
CoroutineCallback, and VectorsDB so Log.d resolves correctly; ensure there are
no import collisions and rebuild to verify the reference to Log in the update
transaction example is recognized.
docs/examples/java/documentsdb/get-document.md-1-28 (1)

1-28: ⚠️ Potential issue | 🟡 Minor

Add missing import for Log class.

The example uses Log.d() on line 24 but doesn't import android.util.Log.

📦 Proposed fix
 import io.appwrite.Client;
 import io.appwrite.coroutines.CoroutineCallback;
 import io.appwrite.services.DocumentsDB;
+import android.util.Log;
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/examples/java/documentsdb/get-document.md` around lines 1 - 28, The
example uses android.util.Log but lacks its import; add an import statement for
Log (import android.util.Log;) at the top of the snippet so the call to
Log.d(...) in the DocumentsDB.getDocument callback compiles; locate the example
code where DocumentsDB and CoroutineCallback are used to insert the import
alongside the other imports.
docs/examples/java/vectorsdb/get-document.md-1-28 (1)

1-28: ⚠️ Potential issue | 🟡 Minor

Add missing imports for Log and List classes.

The example uses List.of() on line 16 and Log.d() on line 24 but doesn't import the necessary classes.

📦 Proposed fix
 import io.appwrite.Client;
 import io.appwrite.coroutines.CoroutineCallback;
 import io.appwrite.services.VectorsDB;
+import android.util.Log;
+import java.util.List;
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/examples/java/vectorsdb/get-document.md` around lines 1 - 28, The
example is missing imports for List and Log used by List.of() and Log.d() in the
VectorsDB.getDocument example; add the appropriate import statements (e.g.,
import java.util.List; and import android.util.Log;) at the top of the file so
references to List.of() and Log.d() resolve, then ensure the VectorsDB usage
(VectorsDB vectorsDB = new VectorsDB(client); and vectorsDB.getDocument(...))
remains unchanged.
docs/examples/java/vectorsdb/delete-document.md-1-27 (1)

1-27: ⚠️ Potential issue | 🟡 Minor

Add missing import for Log class.

The example uses Log.d() on line 23 but doesn't import android.util.Log.

📦 Proposed fix
 import io.appwrite.Client;
 import io.appwrite.coroutines.CoroutineCallback;
 import io.appwrite.services.VectorsDB;
+import android.util.Log;
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/examples/java/vectorsdb/delete-document.md` around lines 1 - 27, The
example uses android.util.Log in the deleteDocument callback but does not import
it; add the missing import for Log at the top of the file (import
android.util.Log;) so the Log.d(...) call inside the CoroutineCallback in
vectorsDB.deleteDocument resolves; update the imports near Client,
CoroutineCallback, and VectorsDB to include android.util.Log.
docs/examples/java/databases/upsert-documents.md-1-27 (1)

1-27: ⚠️ Potential issue | 🟡 Minor

Add missing imports for Log and List classes.

The example uses List.of() on line 15 and Log.d() on line 23 but doesn't import the necessary classes.

📦 Proposed fix
 import io.appwrite.Client;
 import io.appwrite.coroutines.CoroutineCallback;
 import io.appwrite.services.Databases;
+import android.util.Log;
+import java.util.List;
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/examples/java/databases/upsert-documents.md` around lines 1 - 27, The
example is missing imports for the types used: add imports for java.util.List
(used by List.of()) and android.util.Log (used by Log.d()) at the top of the
snippet so the calls in databases.upsertDocuments(...) compile; ensure the
imports appear alongside the existing imports (e.g., near Client,
CoroutineCallback, Databases).
docs/examples/java/documentsdb/create-document.md-1-36 (1)

1-36: ⚠️ Potential issue | 🟡 Minor

Add missing imports for Log, Map, and List classes.

The example uses Map.of() on line 18, List.of() on line 25, and Log.d() on line 32 but doesn't import the necessary classes.

📦 Proposed fix
 import io.appwrite.Client;
 import io.appwrite.coroutines.CoroutineCallback;
 import io.appwrite.Permission;
 import io.appwrite.Role;
 import io.appwrite.services.DocumentsDB;
+import android.util.Log;
+import java.util.Map;
+import java.util.List;
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/examples/java/documentsdb/create-document.md` around lines 1 - 36, The
example is missing imports for Map, List, and Log which are used by Map.of(),
List.of(), and Log.d(); add the appropriate imports (e.g., java.util.Map,
java.util.List, and android.util.Log) at the top of the file so the
DocumentsDB.createDocument call and the CoroutineCallback callback compile
correctly and Log.d resolves.
CHANGELOG.md-3-8 (1)

3-8: ⚠️ Potential issue | 🟡 Minor

Fix version number in CHANGELOG entry.

Line 7 incorrectly states dependencies were updated to 12.1.0, but the actual dependency version published is 12.1.1 (as shown in README.md lines 41 and 52). Update this to 12.1.1 to match the actual release version.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@CHANGELOG.md` around lines 3 - 8, Update the incorrect dependency version
string in the CHANGELOG entry: replace the phrase "Updated Gradle/Maven
dependencies to `12.1.0`" with "Updated Gradle/Maven dependencies to `12.1.1`"
so the CHANGELOG's listed Gradle/Maven dependency version (`12.1.0`) matches the
actual published release version (`12.1.1`) and the README references.
🧹 Nitpick comments (31)
docs/examples/kotlin/vectorsdb/delete-document.md (1)

3-3: Remove unused import.

The CoroutineCallback import is not used in this Kotlin example. Kotlin suspend functions don't require callbacks.

🧹 Proposed fix to remove the unused import
 ```kotlin
 import io.appwrite.Client
-import io.appwrite.coroutines.CoroutineCallback
 import io.appwrite.services.VectorsDB

 val client = Client(context)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/examples/kotlin/vectorsdb/delete-document.md` at line 3, Remove the
unused import "import io.appwrite.coroutines.CoroutineCallback" from the Kotlin
example; the code uses suspend functions and doesn't need CoroutineCallback—keep
the necessary imports such as Client and VectorsDB and ensure no other unused
imports remain (reference symbols: CoroutineCallback, Client, VectorsDB).
docs/examples/kotlin/documentsdb/delete-document.md (1)

3-3: Remove unused import.

The CoroutineCallback import is not used in this Kotlin example. Kotlin suspend functions don't require callbacks.

🧹 Proposed fix to remove the unused import
 ```kotlin
 import io.appwrite.Client
-import io.appwrite.coroutines.CoroutineCallback
 import io.appwrite.services.DocumentsDB

 val client = Client(context)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/examples/kotlin/documentsdb/delete-document.md` at line 3, Remove the
unused import statement "import io.appwrite.coroutines.CoroutineCallback" from
the Kotlin example so only the required imports remain (e.g., "import
io.appwrite.Client" and "import io.appwrite.services.DocumentsDB"); Kotlin
suspend-based examples do not need CoroutineCallback, so delete that import line
to clean up the file.
docs/examples/kotlin/documentsdb/list-transactions.md (1)

3-3: Remove unused import.

The CoroutineCallback import is not used in this Kotlin example. Kotlin suspend functions don't require callbacks; they can be called directly within a coroutine context.

🧹 Proposed fix to remove the unused import
 ```kotlin
 import io.appwrite.Client
-import io.appwrite.coroutines.CoroutineCallback
 import io.appwrite.services.DocumentsDB

 val client = Client(context)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/examples/kotlin/documentsdb/list-transactions.md` at line 3, Remove the
unused import CoroutineCallback from the Kotlin example: delete the line
importing io.appwrite.coroutines.CoroutineCallback since the code uses suspend
functions and the import is unnecessary; ensure remaining imports include
io.appwrite.Client and io.appwrite.services.DocumentsDB and that no references
to CoroutineCallback remain in the example.
docs/examples/kotlin/vectorsdb/create-operations.md (1)

3-3: Remove unused import.

CoroutineCallback is imported but never used in this Kotlin example. The code uses suspend functions directly, which don't require the callback import.

🧹 Proposed fix to remove the unused import
 ```kotlin
 import io.appwrite.Client
-import io.appwrite.coroutines.CoroutineCallback
 import io.appwrite.services.VectorsDB
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/examples/kotlin/vectorsdb/create-operations.md` at line 3, Remove the
unused import CoroutineCallback from the Kotlin example: delete the line
importing io.appwrite.coroutines.CoroutineCallback so the example uses only the
required imports (e.g., Client and VectorsDB) and relies on suspend functions
rather than callback types.
docs/examples/kotlin/documentsdb/list-documents.md (2)

3-3: Remove unused import.

CoroutineCallback is imported but never used in this Kotlin example. The code uses suspend functions directly, which don't require the callback import.

🧹 Proposed fix to remove the unused import
 ```kotlin
 import io.appwrite.Client
-import io.appwrite.coroutines.CoroutineCallback
 import io.appwrite.services.DocumentsDB
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/examples/kotlin/documentsdb/list-documents.md` at line 3, The import
io.appwrite.coroutines.CoroutineCallback is unused in the Kotlin example; remove
that import to clean up the file and rely on the suspend-style usage (keep
imports like io.appwrite.Client and io.appwrite.services.DocumentsDB intact).
Locate the import statement for CoroutineCallback and delete it so the file no
longer contains the unused symbol.

18-18: Consider clarifying the ttl parameter usage.

The example sets ttl to 0, which may be ambiguous. If 0 has special meaning (e.g., no expiration) or if null should be used instead for the default behavior, consider adding a comment to clarify this for users.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/examples/kotlin/documentsdb/list-documents.md` at line 18, The example
sets the parameter ttl = 0 which is ambiguous; update the Kotlin snippet to
clarify ttl's semantics for the reader by either using a null/default value
(e.g., ttl = null) if that indicates no expiration or by adding an inline
comment next to ttl (e.g., // 0 = no expiration or // null = use default TTL) so
users of the ttl parameter understand the intended behavior — refer to the ttl
parameter in the example and adjust the comment or value accordingly.
docs/examples/kotlin/databases/upsert-documents.md (1)

3-3: Remove unused import.

CoroutineCallback is imported but never used in this Kotlin example. The code uses suspend functions directly, which don't require the callback import.

🧹 Proposed fix to remove the unused import
 ```kotlin
 import io.appwrite.Client
-import io.appwrite.coroutines.CoroutineCallback
 import io.appwrite.services.Databases
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/examples/kotlin/databases/upsert-documents.md` at line 3, Remove the
unused import CoroutineCallback from the Kotlin example; locate the import
statement that references CoroutineCallback (import
io.appwrite.coroutines.CoroutineCallback) and delete it so the file only imports
io.appwrite.Client and io.appwrite.services.Databases, since the example uses
suspend functions and does not require the CoroutineCallback symbol.
docs/examples/kotlin/documentsdb/create-document.md (1)

3-3: Remove unused import.

CoroutineCallback is imported but never used in this Kotlin example. The code uses suspend functions directly, which don't require the callback import.

🧹 Proposed fix to remove the unused import
 ```kotlin
 import io.appwrite.Client
-import io.appwrite.coroutines.CoroutineCallback
 import io.appwrite.services.DocumentsDB
 import io.appwrite.Permission
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/examples/kotlin/documentsdb/create-document.md` at line 3, Remove the
unused import CoroutineCallback from the example — the Kotlin code uses suspend
functions and does not reference io.appwrite.coroutines.CoroutineCallback, so
delete the line importing CoroutineCallback to clean up unused imports (look for
the import statement that mentions CoroutineCallback near the other imports like
io.appwrite.Client and io.appwrite.services.DocumentsDB).
docs/examples/java/documentsdb/list-documents.md (1)

18-18: Consider clarifying the ttl parameter usage.

The example sets ttl to 0, which may be ambiguous. If 0 has special meaning (e.g., no expiration) or if null should be used instead for the default behavior, consider adding a comment to clarify this for users.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/examples/java/documentsdb/list-documents.md` at line 18, The example
line "0, // ttl (optional)" is ambiguous about the ttl semantics; update the
example to clarify what 0 means (e.g., "0 // no expiration" or "null // use
default/no expiration") by changing the inline comment for the ttl parameter so
users know whether 0 is special or if they should pass null to get default
behavior — reference the ttl parameter in the example snippet (the line
currently showing "0, // ttl (optional)").
docs/examples/kotlin/documentsdb/create-transaction.md (1)

1-15: Remove unused CoroutineCallback import.

The example imports CoroutineCallback at line 3 but never uses it. This Kotlin example uses direct assignment (val result = ...) instead of a callback pattern, so the import is unnecessary.

♻️ Proposed fix to remove unused import
 ```kotlin
 import io.appwrite.Client
-import io.appwrite.coroutines.CoroutineCallback
 import io.appwrite.services.DocumentsDB

 val client = Client(context)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/examples/kotlin/documentsdb/create-transaction.md` around lines 1 - 15,
Remove the unused import io.appwrite.coroutines.CoroutineCallback from the
Kotlin example; locate the top imports (Client, CoroutineCallback, DocumentsDB)
and delete the CoroutineCallback import so only the used imports
(io.appwrite.Client and io.appwrite.services.DocumentsDB) remain while leaving
the rest of the createTransaction example (DocumentsDB and createTransaction
call) unchanged.
docs/examples/kotlin/vectorsdb/upsert-document.md (1)

1-22: Remove unused CoroutineCallback import.

The example imports CoroutineCallback at line 3 but never uses it. This Kotlin example uses direct assignment (val result = ...) instead of a callback pattern, so the import is unnecessary.

♻️ Proposed fix to remove unused import
 ```kotlin
 import io.appwrite.Client
-import io.appwrite.coroutines.CoroutineCallback
 import io.appwrite.services.VectorsDB
 import io.appwrite.Permission
 import io.appwrite.Role
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/examples/kotlin/vectorsdb/upsert-document.md` around lines 1 - 22, The
import io.appwrite.coroutines.CoroutineCallback is unused in this example;
remove that import line so only used symbols (Client, VectorsDB, Permission,
Role) remain imported, ensuring no unused imports in the upsertDocument example
and keeping the file clean.
docs/examples/kotlin/documentsdb/update-document.md (1)

1-22: Remove unused CoroutineCallback import.

The example imports CoroutineCallback at line 3 but never uses it. This Kotlin example uses direct assignment (val result = ...) instead of a callback pattern, so the import is unnecessary.

♻️ Proposed fix to remove unused import
 ```kotlin
 import io.appwrite.Client
-import io.appwrite.coroutines.CoroutineCallback
 import io.appwrite.services.DocumentsDB
 import io.appwrite.Permission
 import io.appwrite.Role
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/examples/kotlin/documentsdb/update-document.md` around lines 1 - 22, The
import io.appwrite.coroutines.CoroutineCallback is unused in this example and
should be removed; edit the Kotlin snippet to delete the CoroutineCallback
import line so only necessary imports remain (e.g., keep io.appwrite.Client,
io.appwrite.services.DocumentsDB, io.appwrite.Permission, io.appwrite.Role)
while leaving the DocumentsDB instantiation and updateDocument usage unchanged.
docs/examples/kotlin/vectorsdb/create-document.md (1)

1-26: Remove unused CoroutineCallback import.

The example imports CoroutineCallback at line 3 but never uses it. This Kotlin example uses direct assignment (val result = ...) instead of a callback pattern, so the import is unnecessary.

♻️ Proposed fix to remove unused import
 ```kotlin
 import io.appwrite.Client
-import io.appwrite.coroutines.CoroutineCallback
 import io.appwrite.services.VectorsDB
 import io.appwrite.Permission
 import io.appwrite.Role
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/examples/kotlin/vectorsdb/create-document.md` around lines 1 - 26, The
file imports an unused symbol CoroutineCallback; remove the unused import line
so the Kotlin example only imports the symbols actually used (Client, VectorsDB,
Permission, Role) and leave the createDocument example unchanged; look for the
import statement referencing io.appwrite.coroutines.CoroutineCallback and delete
it to fix the unused-import warning.
docs/examples/java/documentsdb/increment-document-attribute.md (1)

16-16: Use a clearer placeholder for the attribute name.

Line 16 uses an empty string "" for the attribute parameter. This is less clear than other placeholders in the example (e.g., "<DATABASE_ID>"). Consider using "<ATTRIBUTE_NAME>" to maintain consistency.

♻️ Proposed fix for clearer placeholder
     "<DATABASE_ID>", // databaseId 
     "<COLLECTION_ID>", // collectionId 
     "<DOCUMENT_ID>", // documentId 
-    "", // attribute 
+    "<ATTRIBUTE_NAME>", // attribute 
     0, // value (optional)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/examples/java/documentsdb/increment-document-attribute.md` at line 16,
Replace the empty string placeholder used for the attribute parameter with a
clearer named placeholder; change "" to "<ATTRIBUTE_NAME>" wherever the
attribute name is passed (e.g., in the call that currently shows "", which
represents the attribute parameter) so the example matches other placeholders
like "<DATABASE_ID>" and is clearer to readers.
docs/examples/kotlin/vectorsdb/get-document.md (1)

3-3: Drop unused callback import for clarity.

This example demonstrates direct result retrieval, so CoroutineCallback is unnecessary.

Proposed doc cleanup
-import io.appwrite.coroutines.CoroutineCallback
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/examples/kotlin/vectorsdb/get-document.md` at line 3, Remove the unused
import of CoroutineCallback from the Kotlin example file: delete the line
importing io.appwrite.coroutines.CoroutineCallback so the example only contains
required imports and avoids confusing readers with an unused callback type
(search for the import statement referencing CoroutineCallback to locate and
remove it).
docs/examples/kotlin/documentsdb/create-operations.md (1)

3-3: Remove unused callback import in this Kotlin suspend-style example.

CoroutineCallback is not used in this snippet, so Line 3 is misleading for the style being shown.

Proposed doc cleanup
-import io.appwrite.coroutines.CoroutineCallback
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/examples/kotlin/documentsdb/create-operations.md` at line 3, The example
imports an unused CoroutineCallback which is misleading for this Kotlin
suspend-style snippet; remove the import statement for CoroutineCallback so the
code only shows suspend-style usage (locate and delete the line importing
CoroutineCallback).
docs/examples/kotlin/documentsdb/decrement-document-attribute.md (2)

16-16: Use a more descriptive attribute name in the example.

The attribute parameter is set to an empty string "", which doesn't illustrate typical usage. Consider using a descriptive name like "counter" or "quantity".

♻️ Proposed improvement
-    attribute = "", 
+    attribute = "counter", 
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/examples/kotlin/documentsdb/decrement-document-attribute.md` at line 16,
The example sets the parameter named attribute to an empty string which is
non-descriptive; update the example call that includes the attribute parameter
(the "attribute" argument in the decrement-document-attribute example) to use a
meaningful name such as "counter" or "quantity" so readers see real
usage—replace the empty string value for attribute with "counter" (or
"quantity") wherever the attribute parameter is passed in the example.

3-3: Remove unused import.

The CoroutineCallback import is unnecessary for this Kotlin suspend function example. The example uses direct assignment (val result = ...) rather than callback-based async handling.

♻️ Proposed fix
 import io.appwrite.Client
-import io.appwrite.coroutines.CoroutineCallback
 import io.appwrite.services.DocumentsDB
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/examples/kotlin/documentsdb/decrement-document-attribute.md` at line 3,
Remove the unnecessary import "import io.appwrite.coroutines.CoroutineCallback"
from the Kotlin example: the suspend-based function (the example using "val
result = ...") does not use CoroutineCallback, so delete that import to
eliminate the unused symbol.
docs/examples/kotlin/vectorsdb/list-documents.md (1)

3-3: Remove unused import.

The CoroutineCallback import is unnecessary for this Kotlin suspend function example. The example uses direct assignment (val result = ...) rather than callback-based async handling.

♻️ Proposed fix
 import io.appwrite.Client
-import io.appwrite.coroutines.CoroutineCallback
 import io.appwrite.services.VectorsDB
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/examples/kotlin/vectorsdb/list-documents.md` at line 3, Remove the
unused import of CoroutineCallback from the Kotlin example: delete the import
statement for CoroutineCallback since the example uses a suspend function with
direct assignment (val result = ...) instead of callback-based async handling;
ensure no other references to CoroutineCallback remain in the snippet (e.g.,
check for any usages in listDocuments or surrounding example code) and keep the
rest of the example unchanged.
docs/examples/kotlin/vectorsdb/update-document.md (1)

3-3: Remove unused import.

The CoroutineCallback import is unnecessary for this Kotlin suspend function example. The example uses direct assignment (val result = ...) rather than callback-based async handling.

♻️ Proposed fix
 import io.appwrite.Client
-import io.appwrite.coroutines.CoroutineCallback
 import io.appwrite.services.VectorsDB
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/examples/kotlin/vectorsdb/update-document.md` at line 3, Remove the
unused import of CoroutineCallback from the Kotlin example: locate the import
statement "import io.appwrite.coroutines.CoroutineCallback" and delete it since
the suspend-function example uses direct assignment (e.g., val result = ...) and
does not use callback-based APIs; ensure no other code references
CoroutineCallback after removal.
docs/examples/java/databases/upsert-documents.md (1)

15-15: Consider adding a non-empty example for the documents parameter.

The example passes an empty list List.of() for the documents parameter, which doesn't demonstrate the expected structure or usage of the upsert operation.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/examples/java/databases/upsert-documents.md` at line 15, The example
currently passes an empty List.of() for the documents parameter; replace it with
a non-empty example showing the expected document structure (e.g., a List
containing one or more document objects/maps with keys like "id",
"text"/"content", and any metadata) so readers can see how to format and upsert
actual documents; update the example in the docs file where the documents
parameter is supplied (the List.of() occurrence) to include a concrete sample
document entry.
docs/examples/java/vectorsdb/upsert-document.md (1)

1-30: Missing imports for Log, Map, and List.

The example uses Log.d, Map.of, and List.of but doesn't include their imports. Add the missing imports for completeness.

📝 Suggested fix
 ```java
 import io.appwrite.Client;
 import io.appwrite.coroutines.CoroutineCallback;
 import io.appwrite.Permission;
 import io.appwrite.Role;
 import io.appwrite.services.VectorsDB;
+import android.util.Log;
+import java.util.List;
+import java.util.Map;
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/examples/java/vectorsdb/upsert-document.md` around lines 1 - 30, The
example is missing imports for Log, List, and Map used by the
VectorsDB.upsertDocument example; add import statements for android.util.Log and
java.util.List and java.util.Map at the top alongside existing imports so Log.d,
List.of(...) and Map.of(...) resolve correctly when using
VectorsDB.upsertDocument in the sample.
docs/examples/kotlin/documentsdb/get-document.md (1)

3-3: Unused import CoroutineCallback.

This Kotlin example uses the suspend function style (direct assignment to val result), so the CoroutineCallback import is not needed and can be removed.

📝 Suggested fix
 ```kotlin
 import io.appwrite.Client
-import io.appwrite.coroutines.CoroutineCallback
 import io.appwrite.services.DocumentsDB
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/examples/kotlin/documentsdb/get-document.md` at line 3, Remove the
unused import line "import io.appwrite.coroutines.CoroutineCallback" from the
Kotlin example; the code uses the suspend-style direct assignment (e.g., the val
result pattern with DocumentsDB) so delete the CoroutineCallback import to avoid
an unused import warning and keep imports limited to "io.appwrite.Client" and
"io.appwrite.services.DocumentsDB".
docs/examples/java/documentsdb/decrement-document-attribute.md (1)

16-18: Improve attribute placeholder and use Double literals.

  1. The attribute placeholder should follow the convention of other placeholders (e.g., "<ATTRIBUTE>").
  2. The value and min parameters expect Double? - use double literals for clarity.
📝 Suggested fix
-    "", // attribute 
-    0, // value (optional)
-    0, // min (optional)
+    "<ATTRIBUTE>", // attribute 
+    1.0, // value (optional)
+    0.0, // min (optional)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/examples/java/documentsdb/decrement-document-attribute.md` around lines
16 - 18, Update the placeholders in the example so the attribute follows the
existing convention (replace the empty string with "<ATTRIBUTE>") and ensure
numeric parameters use Double literals: change the value and min placeholders
from 0 to 0.0 to reflect the expected Double? types (referencing the
"attribute", "value", and "min" parameters shown in the snippet).
docs/examples/java/vectorsdb/create-document.md (1)

1-34: Missing imports for Log, Map, and List.

Same as other VectorsDB examples - add the missing imports for android.util.Log, java.util.List, and java.util.Map.

📝 Suggested fix
 ```java
 import io.appwrite.Client;
 import io.appwrite.coroutines.CoroutineCallback;
 import io.appwrite.Permission;
 import io.appwrite.Role;
 import io.appwrite.services.VectorsDB;
+import android.util.Log;
+import java.util.List;
+import java.util.Map;
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/examples/java/vectorsdb/create-document.md` around lines 1 - 34, The
example is missing imports used by the snippet; add the android.util.Log,
java.util.List, and java.util.Map imports at the top of the file so symbols used
in the example (e.g., Log and the Map/List types in the vectorsDB.createDocument
call and its Map.of/List.of data) resolve correctly; update the imports
alongside existing ones like io.appwrite.Client, io.appwrite.services.VectorsDB,
and io.appwrite.coroutines.CoroutineCallback.
docs/examples/java/documentsdb/create-operations.md (1)

1-32: Missing imports for Log, List, and Map.

Add the missing imports for completeness, consistent with other Java documentation examples.

📝 Suggested fix
 ```java
 import io.appwrite.Client;
 import io.appwrite.coroutines.CoroutineCallback;
 import io.appwrite.services.DocumentsDB;
+import android.util.Log;
+import java.util.List;
+import java.util.Map;
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/examples/java/documentsdb/create-operations.md` around lines 1 - 32, The
example is missing imports used by the DocumentsDB createOperations snippet; add
imports for android.util.Log, java.util.List, and java.util.Map at the top of
the Java example so types referenced in List.of/Map.of and the Log.d usage
resolve correctly — ensure the import statements appear alongside the existing
imports for io.appwrite.Client, io.appwrite.coroutines.CoroutineCallback, and
io.appwrite.services.DocumentsDB.
library/src/main/java/io/appwrite/services/VectorsDB.kt (2)

164-176: Unnecessary content-type header on DELETE request.

DELETE requests typically have no request body, so setting the content-type header is unnecessary. The same applies to deleteDocument at Line 615.

♻️ Suggested fix
         val apiHeaders = mutableMapOf<String, String>(
-            "content-type" to "application/json",
         )
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@library/src/main/java/io/appwrite/services/VectorsDB.kt` around lines 164 -
176, Remove the unnecessary "content-type" header from DELETE requests: in the
shown DELETE method (the function that builds apiHeaders with "content-type" and
calls client.call with "DELETE") and in the deleteDocument method, delete the
"content-type" entry so apiHeaders is either empty or only contains required
headers (e.g., auth headers). Ensure you only remove that header for DELETE
calls and keep any other needed headers intact.

12-14: Empty class-level documentation.

The class KDoc is empty. Consider adding a brief description of the VectorsDB service and its purpose for better API discoverability.

📝 Suggested documentation
-/**
- * 
- */
+/**
+ * The VectorsDB service provides methods to interact with Appwrite VectorsDB,
+ * including transaction management and document CRUD operations for vector collections.
+ */
 class VectorsDB(client: Client) : Service(client) {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@library/src/main/java/io/appwrite/services/VectorsDB.kt` around lines 12 -
14, Add a concise KDoc comment above the VectorsDB class that describes what the
VectorsDB service does and its purpose for consumers (e.g., manages vector
storage/search operations and provides methods to interact with the Appwrite
vectors API); include mention of any important constructor parameters or
responsibilities (for example the Client dependency injected into VectorsDB) so
the generated API docs are informative and improve discoverability.
library/src/main/java/io/appwrite/services/DocumentsDB.kt (3)

12-14: Empty class-level documentation.

Similar to VectorsDB, the class KDoc is empty. Consider adding a description of the DocumentsDB service.

📝 Suggested documentation
-/**
- * 
- */
+/**
+ * The DocumentsDB service provides methods to interact with Appwrite DocumentsDB,
+ * including transaction management, document CRUD operations, and atomic attribute mutations.
+ */
 class DocumentsDB(client: Client) : Service(client) {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@library/src/main/java/io/appwrite/services/DocumentsDB.kt` around lines 12 -
14, Add a descriptive KDoc for the DocumentsDB class (class DocumentsDB) similar
to the one used for VectorsDB: briefly explain the purpose of the DocumentsDB
service, what it manages (e.g., storing, querying, and managing document
records), any important behaviors or expected usage, and mention any relevant
parameters or scope of the service; place this KDoc immediately above the class
declaration in DocumentsDB.kt so the class-level documentation is no longer
empty.

164-176: Unnecessary content-type header on DELETE request.

Same as noted in VectorsDB.kt - DELETE requests typically have no body, so this header is unnecessary. Also applies to deleteDocument at Line 673.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@library/src/main/java/io/appwrite/services/DocumentsDB.kt` around lines 164 -
176, Remove the unnecessary "content-type" header from the DELETE request
headers: locate the DELETE client.call invocation in DocumentsDB.kt (the block
building apiHeaders with "content-type" => "application/json") and remove that
header entry so apiHeaders doesn't include content-type for DELETE requests;
apply the same change to the deleteDocument implementation referenced in this
file to ensure DELETE calls do not send a content-type header when there's no
request body.

17-212: Consider extracting shared transaction logic.

The transaction management APIs (listTransactions, createTransaction, getTransaction, updateTransaction, deleteTransaction, createOperations) are nearly identical to those in VectorsDB.kt, differing only in the base path (/documentsdb vs /vectorsdb).

If these services are manually maintained, consider extracting a shared base class or delegate to reduce duplication. If auto-generated from an API spec, this can be ignored.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@library/src/main/java/io/appwrite/services/DocumentsDB.kt` around lines 17 -
212, The transaction methods in DocumentsDB (listTransactions,
createTransaction, getTransaction, updateTransaction, deleteTransaction,
createOperations) duplicate the same logic found in VectorsDB; extract the
common behavior into a shared helper or base class (e.g., TransactionService or
DocumentsVectorsBase) that accepts the base path ("/documentsdb" vs
"/vectorsdb") and encapsulates building apiPath, apiParams, apiHeaders,
converters, and the client.call invocation, then have DocumentsDB and VectorsDB
delegate their transaction methods to that shared class (or call its generic
methods) so only basePath differs while keeping existing method names and
signatures intact.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 278785d3-eb4d-4b6b-aeb6-888d5da3b621

📥 Commits

Reviewing files that changed from the base of the PR and between 3085659 and 0ad33c7.

📒 Files selected for processing (66)
  • CHANGELOG.md
  • README.md
  • docs/examples/java/databases/upsert-documents.md
  • docs/examples/java/documentsdb/create-document.md
  • docs/examples/java/documentsdb/create-documents.md
  • docs/examples/java/documentsdb/create-operations.md
  • docs/examples/java/documentsdb/create-transaction.md
  • docs/examples/java/documentsdb/decrement-document-attribute.md
  • docs/examples/java/documentsdb/delete-document.md
  • docs/examples/java/documentsdb/delete-transaction.md
  • docs/examples/java/documentsdb/get-document.md
  • docs/examples/java/documentsdb/get-transaction.md
  • docs/examples/java/documentsdb/increment-document-attribute.md
  • docs/examples/java/documentsdb/list-documents.md
  • docs/examples/java/documentsdb/list-transactions.md
  • docs/examples/java/documentsdb/update-document.md
  • docs/examples/java/documentsdb/update-transaction.md
  • docs/examples/java/documentsdb/upsert-document.md
  • docs/examples/java/vectorsdb/create-document.md
  • docs/examples/java/vectorsdb/create-operations.md
  • docs/examples/java/vectorsdb/create-transaction.md
  • docs/examples/java/vectorsdb/delete-document.md
  • docs/examples/java/vectorsdb/delete-transaction.md
  • docs/examples/java/vectorsdb/get-document.md
  • docs/examples/java/vectorsdb/get-transaction.md
  • docs/examples/java/vectorsdb/list-documents.md
  • docs/examples/java/vectorsdb/list-transactions.md
  • docs/examples/java/vectorsdb/update-document.md
  • docs/examples/java/vectorsdb/update-transaction.md
  • docs/examples/java/vectorsdb/upsert-document.md
  • docs/examples/kotlin/databases/upsert-documents.md
  • docs/examples/kotlin/documentsdb/create-document.md
  • docs/examples/kotlin/documentsdb/create-documents.md
  • docs/examples/kotlin/documentsdb/create-operations.md
  • docs/examples/kotlin/documentsdb/create-transaction.md
  • docs/examples/kotlin/documentsdb/decrement-document-attribute.md
  • docs/examples/kotlin/documentsdb/delete-document.md
  • docs/examples/kotlin/documentsdb/delete-transaction.md
  • docs/examples/kotlin/documentsdb/get-document.md
  • docs/examples/kotlin/documentsdb/get-transaction.md
  • docs/examples/kotlin/documentsdb/increment-document-attribute.md
  • docs/examples/kotlin/documentsdb/list-documents.md
  • docs/examples/kotlin/documentsdb/list-transactions.md
  • docs/examples/kotlin/documentsdb/update-document.md
  • docs/examples/kotlin/documentsdb/update-transaction.md
  • docs/examples/kotlin/documentsdb/upsert-document.md
  • docs/examples/kotlin/vectorsdb/create-document.md
  • docs/examples/kotlin/vectorsdb/create-operations.md
  • docs/examples/kotlin/vectorsdb/create-transaction.md
  • docs/examples/kotlin/vectorsdb/delete-document.md
  • docs/examples/kotlin/vectorsdb/delete-transaction.md
  • docs/examples/kotlin/vectorsdb/get-document.md
  • docs/examples/kotlin/vectorsdb/get-transaction.md
  • docs/examples/kotlin/vectorsdb/list-documents.md
  • docs/examples/kotlin/vectorsdb/list-transactions.md
  • docs/examples/kotlin/vectorsdb/update-document.md
  • docs/examples/kotlin/vectorsdb/update-transaction.md
  • docs/examples/kotlin/vectorsdb/upsert-document.md
  • library/src/main/java/io/appwrite/Client.kt
  • library/src/main/java/io/appwrite/models/Document.kt
  • library/src/main/java/io/appwrite/models/Log.kt
  • library/src/main/java/io/appwrite/models/Row.kt
  • library/src/main/java/io/appwrite/models/User.kt
  • library/src/main/java/io/appwrite/services/Databases.kt
  • library/src/main/java/io/appwrite/services/DocumentsDB.kt
  • library/src/main/java/io/appwrite/services/VectorsDB.kt

Comment on lines +1 to +24
```java
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.DocumentsDB;

Client client = new Client(context)
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
.setProject("<YOUR_PROJECT_ID>"); // Your project ID

DocumentsDB documentsDB = new DocumentsDB(client);

documentsDB.getTransaction(
"<TRANSACTION_ID>", // transactionId
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

Log.d("Appwrite", result.toString());
})
);

```
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Missing import for android.util.Log.

The example uses Log.d() on line 20 but does not import android.util.Log. This will cause a compilation error when users try to run this code.

📦 Proposed fix to add the missing import
 ```java
 import io.appwrite.Client;
 import io.appwrite.coroutines.CoroutineCallback;
 import io.appwrite.services.DocumentsDB;
+import android.util.Log;

 Client client = new Client(context)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/examples/java/documentsdb/get-transaction.md` around lines 1 - 24, The
example calls android.util.Log.d inside the DocumentsDB.getTransaction callback
but omits the required import; add the missing import for android.util.Log at
the top alongside the existing imports (so the file imports android.util.Log in
addition to io.appwrite.Client, io.appwrite.coroutines.CoroutineCallback, and
io.appwrite.services.DocumentsDB) so that the use of Log.d in the
CoroutineCallback compiles.

Comment on lines +1 to +26
```java
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.DocumentsDB;

Client client = new Client(context)
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
.setProject("<YOUR_PROJECT_ID>"); // Your project ID

DocumentsDB documentsDB = new DocumentsDB(client);

documentsDB.updateTransaction(
"<TRANSACTION_ID>", // transactionId
false, // commit (optional)
false, // rollback (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

Log.d("Appwrite", result.toString());
})
);

```
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Missing import for android.util.Log.

The example uses Log.d() on line 22 but does not import android.util.Log. This will cause a compilation error.

📦 Proposed fix to add the missing import
 ```java
 import io.appwrite.Client;
 import io.appwrite.coroutines.CoroutineCallback;
 import io.appwrite.services.DocumentsDB;
+import android.util.Log;

 Client client = new Client(context)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
```java
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.DocumentsDB;
Client client = new Client(context)
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
.setProject("<YOUR_PROJECT_ID>"); // Your project ID
DocumentsDB documentsDB = new DocumentsDB(client);
documentsDB.updateTransaction(
"<TRANSACTION_ID>", // transactionId
false, // commit (optional)
false, // rollback (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}
Log.d("Appwrite", result.toString());
})
);
```
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/examples/java/documentsdb/update-transaction.md` around lines 1 - 26,
The example is missing the android.util.Log import used by Log.d in the
DocumentsDB.updateTransaction callback; add the line importing android.util.Log
alongside the other imports (near import io.appwrite.services.DocumentsDB) so
the Log symbol resolves and the sample compiles.

Comment on lines +1 to +24
```java
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.VectorsDB;

Client client = new Client(context)
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
.setProject("<YOUR_PROJECT_ID>"); // Your project ID

VectorsDB vectorsDB = new VectorsDB(client);

vectorsDB.getTransaction(
"<TRANSACTION_ID>", // transactionId
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

Log.d("Appwrite", result.toString());
})
);

```
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Missing import for android.util.Log.

The example uses Log.d() on line 20 but does not import android.util.Log. This will cause a compilation error.

📦 Proposed fix to add the missing import
 ```java
 import io.appwrite.Client;
 import io.appwrite.coroutines.CoroutineCallback;
 import io.appwrite.services.VectorsDB;
+import android.util.Log;

 Client client = new Client(context)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/examples/java/vectorsdb/get-transaction.md` around lines 1 - 24, The
example calls android.util.Log.d in the VectorsDB.getTransaction callback but
the android.util.Log import is missing; add the import statement for
android.util.Log at the top of the file so the Log.d(...) call in the
CoroutineCallback for getTransaction resolves and the example compiles.

Comment on lines +1 to +24
```java
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.VectorsDB;

Client client = new Client(context)
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
.setProject("<YOUR_PROJECT_ID>"); // Your project ID

VectorsDB vectorsDB = new VectorsDB(client);

vectorsDB.listTransactions(
List.of(), // queries (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

Log.d("Appwrite", result.toString());
})
);

```
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Missing import for android.util.Log.

The example uses Log.d() on line 20 but does not import android.util.Log. This will cause a compilation error.

📦 Proposed fix to add the missing import
 ```java
 import io.appwrite.Client;
 import io.appwrite.coroutines.CoroutineCallback;
 import io.appwrite.services.VectorsDB;
+import android.util.Log;

 Client client = new Client(context)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/examples/java/vectorsdb/list-transactions.md` around lines 1 - 24, The
Java example uses android.util.Log (Log.d) but the import is missing, causing a
compilation error; add the import for android.util.Log near the other imports so
the Log.d(...) call in the CoroutineCallback succeeds—update the import block
that includes Client, CoroutineCallback, and VectorsDB to also import
android.util.Log.

Comment on lines +12 to +17
val result = databases.upsertDocuments(
databaseId = "<DATABASE_ID>",
collectionId = "<COLLECTION_ID>",
documents = listOf(),
transactionId = "<TRANSACTION_ID>", // (optional)
)
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Check if upsertDocuments is marked as deprecated in the SDK source and if there's a recommended alternative

# Search for deprecation annotation on upsertDocuments
rg -n -A5 -B2 '@Deprecated|@deprecated' library/src/main/java/io/appwrite/services/Databases.kt | rg -A5 -B2 'upsertDocuments'

# Also check for any deprecation comments or documentation
ast-grep --pattern 'fun upsertDocuments($$$) { $$$ }'

Repository: appwrite/sdk-for-android

Length of output: 341


Add deprecation notice to example documentation.

upsertDocuments is deprecated as of SDK version 1.8.0 and replaced by TablesDB.upsertRows. The example documentation should include a deprecation warning at the top and direct users to the recommended alternative.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/examples/kotlin/databases/upsert-documents.md` around lines 12 - 17, Add
a deprecation notice to this example: indicate that databases.upsertDocuments is
deprecated as of SDK v1.8.0 and recommend using TablesDB.upsertRows instead;
update the top of docs/examples/kotlin/databases/upsert-documents.md to show a
brief deprecation warning and a short pointer to the new TablesDB.upsertRows API
(and consider replacing or adding an equivalent example using
TablesDB.upsertRows alongside the warning). Ensure you reference the deprecated
symbol `upsertDocuments` and the replacement `TablesDB.upsertRows` in the
notice.

Comment on lines +12 to +14
val result = vectorsDB.deleteTransaction(
transactionId = "<TRANSACTION_ID>",
)
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

cat -n docs/examples/kotlin/vectorsdb/delete-transaction.md

Repository: appwrite/sdk-for-android

Length of output: 586


🏁 Script executed:

fd -type f -name "*.kt" | xargs rg "fun deleteTransaction" -A 3 | head -50

Repository: appwrite/sdk-for-android

Length of output: 1737


🏁 Script executed:

fd -type f -path "*/docs/examples/kotlin/vectorsdb/*.md" | xargs cat | grep -A 10 "suspend\|launch\|async\|runBlocking" | head -30

Repository: appwrite/sdk-for-android

Length of output: 238


🏁 Script executed:

find docs/examples/kotlin/vectorsdb -name "*.md" -type f

Repository: appwrite/sdk-for-android

Length of output: 676


🏁 Script executed:

cat docs/examples/kotlin/vectorsdb/create-transaction.md

Repository: appwrite/sdk-for-android

Length of output: 468


🏁 Script executed:

cat docs/examples/kotlin/vectorsdb/get-transaction.md

Repository: appwrite/sdk-for-android

Length of output: 478


Wrap deleteTransaction call in coroutine scope for compilable example.

Line 12 calls a suspend function directly without coroutine context. The code needs to be wrapped in a coroutine scope (e.g., lifecycleScope.launch { }, launch { }, or runBlocking { }):

lifecycleScope.launch {
    val result = vectorsDB.deleteTransaction(
        transactionId = "<TRANSACTION_ID>", 
    )
}

Otherwise the Kotlin example fails to compile.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/examples/kotlin/vectorsdb/delete-transaction.md` around lines 12 - 14,
The example calls the suspend function deleteTransaction on vectorsDB directly;
wrap that call in a coroutine scope (e.g., lifecycleScope.launch, runBlocking,
or a launch within a CoroutineScope) so the suspend function executes within a
coroutine context; update the snippet containing
vectorsDB.deleteTransaction(...) to be placed inside the chosen coroutine
builder (keeping transactionId and other args unchanged).

Comment on lines +12 to +14
val result = vectorsDB.getTransaction(
transactionId = "<TRANSACTION_ID>",
)
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

cat -n docs/examples/kotlin/vectorsdb/get-transaction.md

Repository: appwrite/sdk-for-android

Length of output: 583


🏁 Script executed:

find . -name "*.kt" -type f | xargs grep -l "class VectorsDB" | head -5

Repository: appwrite/sdk-for-android

Length of output: 125


🏁 Script executed:

grep -n "fun getTransaction" ./library/src/main/java/io/appwrite/services/VectorsDB.kt

Repository: appwrite/sdk-for-android

Length of output: 102


🏁 Script executed:

sed -n '88,100p' ./library/src/main/java/io/appwrite/services/VectorsDB.kt

Repository: appwrite/sdk-for-android

Length of output: 602


Wrap getTransaction call in a coroutine scope.

getTransaction is a suspend function and cannot be called directly in synchronous context. The code must be wrapped in a coroutine builder such as launch, async, or runBlocking, or placed inside a suspend function.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/examples/kotlin/vectorsdb/get-transaction.md` around lines 12 - 14, The
example calls the suspend function vectorsDB.getTransaction directly; wrap this
call inside a coroutine context (e.g., runBlocking { ... },
CoroutineScope(Dispatchers.Default).launch { ... }, async { ... } or call from
an existing suspend function) so it runs in a coroutine; locate the
vectorsDB.getTransaction(...) invocation in the example and move it into a
coroutine builder or a suspend function to fix the compile/runtime error.

*/
@SerializedName("\$sequence")
val sequence: Long,
val sequence: String,
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

find . -name "Row.kt" -type f | head -20

Repository: appwrite/sdk-for-android

Length of output: 117


🏁 Script executed:

cd library/src/main/java/io/appwrite/models && ls -la | head -30

Repository: appwrite/sdk-for-android

Length of output: 1891


🏁 Script executed:

wc -l ./library/src/main/java/io/appwrite/models/Row.kt

Repository: appwrite/sdk-for-android

Length of output: 121


🏁 Script executed:

cat -n ./library/src/main/java/io/appwrite/models/Row.kt

Repository: appwrite/sdk-for-android

Length of output: 3388


🏁 Script executed:

rg "map\[" library/src/main/java/io/appwrite/models/*.kt -A 1 -B 1 | head -80

Repository: appwrite/sdk-for-android

Length of output: 7182


🏁 Script executed:

grep -n "as String" library/src/main/java/io/appwrite/models/Row.kt

Repository: appwrite/sdk-for-android

Length of output: 392


🏁 Script executed:

find . -name "jsonCast*" -o -name "*Extension*" | grep -i extension | head -20

Repository: appwrite/sdk-for-android

Length of output: 326


🏁 Script executed:

cat -n ./library/src/main/java/io/appwrite/extensions/JsonExtensions.kt

Repository: appwrite/sdk-for-android

Length of output: 1345


🏁 Script executed:

grep -rn "sequence" library/src/main/java/io/appwrite/models/Row.kt

Repository: appwrite/sdk-for-android

Length of output: 317


🏁 Script executed:

rg "\$sequence" library/ --type java --type kotlin -B 2 -A 2

Repository: appwrite/sdk-for-android

Length of output: 50


🏁 Script executed:

rg "sequence" library/src/test -B 3 -A 3 | head -60

Repository: appwrite/sdk-for-android

Length of output: 124


🏁 Script executed:

find . -name "*.json" -type f | head -10

Repository: appwrite/sdk-for-android

Length of output: 100


🏁 Script executed:

rg "Number" library/src/main/java/io/appwrite/extensions/JsonExtensions.kt -B 2 -A 2

Repository: appwrite/sdk-for-android

Length of output: 380


🏁 Script executed:

rg "as String" library/src/main/java/io/appwrite/models/ | wc -l

Repository: appwrite/sdk-for-android

Length of output: 71


🏁 Script executed:

rg "toLong()" library/src/main/java/io/appwrite/models/ | head -20

Repository: appwrite/sdk-for-android

Length of output: 2349


🏁 Script executed:

cat -n library/src/main/java/io/appwrite/extensions/TypeExtensions.kt

Repository: appwrite/sdk-for-android

Length of output: 362


🏁 Script executed:

rg "Sequence" library/src/main/java/io/appwrite/models/Row.kt -B 3 -A 3

Repository: appwrite/sdk-for-android

Length of output: 50


🏁 Script executed:

git log --oneline library/src/main/java/io/appwrite/models/Row.kt | head -5

Repository: appwrite/sdk-for-android

Length of output: 110


🏁 Script executed:

git show HEAD:library/src/main/java/io/appwrite/models/Row.kt | head -110 | tail -20

Repository: appwrite/sdk-for-android

Length of output: 745


🏁 Script executed:

rg "as String" library/src/main/java/io/appwrite/models/Row.kt -n

Repository: appwrite/sdk-for-android

Length of output: 392


🏁 Script executed:

git diff HEAD~1 library/src/main/java/io/appwrite/models/Row.kt 2>/dev/null || echo "Cannot show diff"

Repository: appwrite/sdk-for-android

Length of output: 84


Fix unsafe $sequence deserialization cast at line 96.

The hard cast sequence = map["\$sequence"] as String in the from() function can fail at runtime if the API payload deserializes this field as a numeric type (per Gson's ToNumberPolicy.LONG_OR_DOUBLE configuration). Make the parsing tolerant to both String and Number types.

Suggested fix
-            sequence = map["\$sequence"] as String,
+            sequence = when (val rawSequence = map["\$sequence"]) {
+                is String -> rawSequence
+                is Number -> rawSequence.toLong().toString()
+                else -> throw IllegalArgumentException("Invalid \$sequence type: ${rawSequence?.javaClass}")
+            },
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@library/src/main/java/io/appwrite/models/Row.kt` at line 20, The
deserialization for Row.sequence in the Row.from() function uses an unsafe cast
`sequence = map["$sequence"] as String`; change it to tolerate either String or
Number by checking the runtime type of map["$sequence"] (e.g., if it's a String
use it directly, if it's a Number call .toString(), and handle null/other types
appropriately) so parsing works when Gson returns numeric types; update the
assignment in Row.from() and any related nullability handling to use the safe
converted string.

Comment on lines +157 to +158
"impersonator" to impersonator as Any,
"impersonatorUserId" to impersonatorUserId as Any,
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

find . -name "User.kt" -type f | grep -E "models.*User.kt"

Repository: appwrite/sdk-for-android

Length of output: 118


🏁 Script executed:

cat -n ./library/src/main/java/io/appwrite/models/User.kt | head -200

Repository: appwrite/sdk-for-android

Length of output: 6568


Do not cast nullable impersonation fields to non-null Any.

Lines 157-158 cast nullable fields to as Any, which throws ClassCastException if the value is null. Both impersonator: Boolean? and impersonatorUserId: String? are nullable, so they must be handled conditionally.

Note: The same unsafe pattern appears on lines 142-144 for password, hash, and hashOptions—consider fixing all nullable field casts in this toMap() function.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@library/src/main/java/io/appwrite/models/User.kt` around lines 157 - 158, The
toMap() implementation is unsafely casting nullable properties to non-null Any
(e.g., impersonator, impersonatorUserId, and also password, hash, hashOptions),
which will throw if the value is null; update toMap() to avoid non-null casts by
either (A) only adding those entries when the property != null, or (B) allow
null values in the map by assigning the property directly (no "as Any" cast) or
casting to Any? (e.g., use impersonator (or impersonator as Any?) removed and
instead add "impersonator" to impersonator, or conditionally put "impersonator"
to impersonator when impersonator != null), and apply the same fix for password,
hash, and hashOptions so all nullable fields are handled safely in User.toMap().

@ChiragAgg5k ChiragAgg5k changed the title feat: Android SDK update for version 12.1.1 feat: Android SDK update for version 13.0.0 Mar 25, 2026
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