-
-
Notifications
You must be signed in to change notification settings - Fork 70
stream returns invalid response #87
Comments
I don't think my changes in #82 are the reason, because I didn't change anything on insert. I guess the bug is in 0.2.11. |
For your information. |
The insert action is correct. It means the correct row data really insert into the database table successfully, but the stream fetch the data and change many columns' data with null. This is the real problem. |
Hi @JasonChiu-dev |
Hi @phamhieu It works correctly now. Thank you so much for your inform and help. |
(Note: Before upgrade to 0.2.12, the stream worked correctly.)
I found the stream has a bug which cause an error: stream replace the correct row and cause error.
When I insert a row into a table, it shows the following error message:
"The method 'toDouble' was called on null.
Receiver: null
Tried calling: toDouble()"
In fact, I checked the data row I insert into the table is correct as follow:
{projectId: 22-038, itemNumber: 7, itemName: test7, unit: M, unitPrice: 1500.0, contractQuantity: 500.0, contractAmount: 750000.0, remark: , cumulativeCompletedQuantity: 0.0}
which is correct data.
After the insert action is finished, the stream response and shows the data as follow:
{contractAmount: null, contractQuantity: null, cumulativeCompletedQuantity: null, id: 87, itemName: test7, itemNumber: 7, projectId: 22-038, remark: , unit: M, unitPrice: null}
at the same time I get the error message I mentioned above. (
"The method 'toDouble' was called on null.
Receiver: null
Tried calling: toDouble()" )
This is because the stream replace my correct row with wrong row which change my original data to "null".
Then, I check the database and found the correct row {projectId: 22-038, itemNumber: 7, itemName: test7, unit: M, unitPrice: 1500.0, contractQuantity: 500.0, contractAmount: 750000.0, remark: , cumulativeCompletedQuantity: 0.0} still insert into the database successfully. But my App become red screen and shows the error message which should not happen!!
It's so strange!!
Before I upgrade to supabase-dart 0.2.12 with new stream usage by primary-key, the stream worked very good and 100% correct for the same code to insert data to database.
How can I resolve this problem??
related to #82
The text was updated successfully, but these errors were encountered: