-
Notifications
You must be signed in to change notification settings - Fork 136
Open
Labels
bugSomething isn't workingSomething isn't working
Description
👟 Reproduction steps
Bug Description
The Appwrite Dart SDK fails to deserialize documents containing the $sequence
field when it's returned as a String instead of an int.
Steps to Reproduce
- Create a collection with documents in Appwrite Cloud
- Use the Dart SDK to call
databases.listDocuments()
- The SDK throws:
TypeError: "1": type 'String' is not a subtype of type 'int'
👍 Expected behavior
Expected Behavior
The SDK should handle the $sequence
field correctly regardless of whether it's returned as a String or int.
👎 Actual Behavior
Actual Behavior
The SDK fails with a TypeError when $sequence
is a String.
🎲 Appwrite version
Different version (specify in environment)
💻 Operating system
Windows
🧱 Your Environment
Environment
- Appwrite SDK: ^17.1.0
- Dart SDK version: 3.8.1 (stable) (Wed May 28 00:47:25 2025 -0700) on "windows_x64"
- Flutter: 3.32.8 • channel stable
Additional Information
- The
$sequence
field is an internal Appwrite field that auto-increments - The API returns it as a String:
"$sequence": "3"
- The SDK expects it as an int:
"$sequence": 3
- This is a type mismatch in the SDK's deserialization logic
Workaround
Using direct HTTP calls with manual JSON parsing works correctly:
final response = await http.get(Uri.parse(url), headers: headers);
final data = json.decode(response.body);
// Manual filtering of system fields works fine
Reproduction Code
final response = await databases.listDocuments(
databaseId: 'your_db_id',
collectionId: 'your_collection_id',
);
// Fails with TypeError when document contains $sequence field
### 👀 Have you spent some time to check if this issue has been raised before?
- [x] I checked and didn't find similar issue
### 🏢 Have you read the Code of Conduct?
- [x] I have read the [Code of Conduct](https://github.com/appwrite/appwrite/blob/HEAD/CODE_OF_CONDUCT.md)
kjm0202, xeladu, Esseker-Dev, hugofpsilva and HungryBytesApps
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working