Hello,
When adding the total parameter (either true, the default, or false) to the listRows function, it raises the following error: type 'bool' is not a subtype of type 'Iterable<dynamic>' when executed.
I'm running Appwrite self-hosted version 1.8.1. Client SDK is Flutter with appwrite package verison 20.3.2.
I reproduced the error on different tables. No errors are reported by the appwrite container
You are not showing your code, but can you try passing a list instead of only boolean?
[True] / [False]
Here is a simple example of where it fails, I tried to pass an Iterable but it does not allow me as per the function specification
err, shouldn't it be total: false? why an array/list?
the function signature is this -
Future<models.RowList> listRows({
required String databaseId,
required String tableId,
List<String>? queries,
String? transactionId,
bool? total
}) async {...}
Exactly, I shared the screenshot just to show a snippet of my code and to show that the function expects a nullable boolean and not an Iterable<dynamic>
Whenever you set the 'total' attribute, either true or false, the listRows call fails with the error type 'bool' is not a subtype of type 'Iterable<dynamic>'
I don't know if it is something failing in the client SDK before the API call or some backend logic not expecting this parameter
err. if the type is bool and you explicitly pass a boolean value, it shouldn't complain.
can you show the error when you do total: false? screenshot would help. i am guessing it could be some stale cache
No complaints from client sdk with a boolean Here is a screenshot with this function running
Which cache are you referring to? On the backend? Can I clear it somehow?
I tried to restart the redis service without success, can I safely delete its volume?
I think there is a bug in the SDK I changed the bool to an Iterable<String> and now the error is reported by the backend: A boolean is expected
Can you try to pass an object:
databases.listRows({
databaseId: …,
tableId: …,
total: false,
})
I'm not sure if Flutter is using object arguments as well
No, it does not allow me such thing
Is the sdk-for-flutter repo the right place to raise an issue? https://github.com/appwrite/sdk-for-flutter The repo is marked as read-only
its read-only as its generated via our sdk-generator. you can still go ahead and create an issue on the repo. I can take a look tomorrow 👍
Alright I've created this issue : https://github.com/appwrite/sdk-for-flutter/issues/292
taking a look into this, and I know whats happening 👍
Great news !
Hey 👋, sdk and backend fixes were deployed sometime ago. please update your flutter sdk and please try again 😄
Hey, thank you, I will try! Do I understand correctly that the fix will not work on self hosted backend yet?
the fix was for sdk. the issue on backend [fixed on Cloud] is that the value is ignored atm and the total will always be returned on self hosted. We'll be discussing this internally regarding the next release 😄
Hey I confirm the total parameter does no longer crash the query. Indeed there is another bug then, looking forward for it to being fixed next version. This issue can be closed
[SOLVED] Skip total counts crash the query
Recommended threads
- local (self-hosted) sites issues
setup: - `composer run installer:dev` issues - Getting error when visiting the site ```Synchronous function execution timed out. Use asynchronous execution in...
- Error With iOS Apps
I keep getting the below errors for my flutter app. The clients are registered and have been. This wasn't an issue a few hours ago. AppwriteException: AppwriteE...
- I'm getting an error on the console "j?....
On my self hosted instance version 1.8.1 the console is giving me this error when trying to view the rows for a table I recently created. My application is read...