Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Bug Report: int field being recognized as String when using realtime #3201

Open
2 tasks done
rafaelgazani opened this issue May 9, 2022 · 3 comments
Open
2 tasks done
Labels
bug Something isn't working

Comments

@rafaelgazani
Copy link

👟 Reproduction steps

"flutterSdkVersion": "2.10.4"
appwrite: ^4.0.2

Listen for changes to a collection with:
realtime.subscribe(['collections.your_collection.documents']);

Create a new document by flutter.
When the client receives this new document, for some reason the int field is arriving as String.

erro int

👍 Expected behavior

The field should arrive at the client as int

👎 Actual Behavior

The first time, only inside the subscription.stream.listen the field is received as String

🎲 Appwrite version

Version 0.13.x

💻 Operating system

Linux

🧱 Your Environment

Default environment v:0.13.4.304
Flutter 2.10.4
flutter web, windows and android

👀 Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

@rafaelgazani rafaelgazani added the bug Something isn't working label May 9, 2022
@rafaelgazani
Copy link
Author

a simple if solves it, but I don't understand why it's getting String the first time:
if (int.tryParse("${response.payload["codigo_i"]}") != null){
response.payload["codigo_i"] = int.parse("${response.payload["codigo_i"]}");
}

@lucasbstn
Copy link

I have the same issue but in my case, null is being parsed to a string "null"...

@joeyouss
Copy link

joeyouss commented Jul 3, 2023

Hi @rafaelgazani , this issue is pretty old and I think this might be fixed now, can we close this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants