Skip to content
This repository has been archived by the owner on May 13, 2023. It is now read-only.

Wrong Parsing of bool values #29

Closed
HubTreeTea opened this issue Dec 4, 2021 · 2 comments · Fixed by #30
Closed

Wrong Parsing of bool values #29

HubTreeTea opened this issue Dec 4, 2021 · 2 comments · Fixed by #30
Labels
bug Something isn't working

Comments

@HubTreeTea
Copy link
Contributor

Bug report

Describe the bug

Boolean values are wrongly transformed, resulting always in null as the value for a boolean field.

To Reproduce

  • subscribe to a table that has a column with a boolean value
  • change a row in the table
  • take a look at the resulting (raw) json string containing the new record
  • compare it with the parsed Map<String, dyanmic> in the SupabaseRealtimePayload and see that all boolean values are now null

Expected behavior

Correct parsing of boolean values.

System information

  • Flutter 2.5.3
  • Dart 2.14.4
  • realtime_client: 0.1.12

Additional context

I did find the cause of this behavior, it lies within the file transformers.dart in the method toBoolean.
There, it only checks for the cases 'f' and 't', however, the previously called .toString() on the value makes the boolean value either 'true' or 'false', which is why the default case is being used, which results in a value of null.

@HubTreeTea HubTreeTea added the bug Something isn't working label Dec 4, 2021
HubTreeTea added a commit to HubTreeTea/realtime-dart that referenced this issue Dec 4, 2021
@HubTreeTea
Copy link
Contributor Author

Great that you reviewed and merged my PR so fast @dshukertjr, thank you. I was wondering however, when we can expect the release of this fixed issue (potentially in version 0.1.13) as I could really use that fix soon. How's your plan there?

@HubTreeTea
Copy link
Contributor Author

Ok, I just saw that the changes were released today in the version 0.1.12+1. Thanks :).

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

Successfully merging a pull request may close this issue.

1 participant