Skip to content

New update remove_control_payload.dart #5366

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

SIRGPrice
Copy link
Contributor

@SIRGPrice SIRGPrice commented Jun 12, 2025

Ensure the control ids list contains only String values when deserializing from JSON, discarding null id values to prevent runtime errors of type:

[ERROR:flutter/runtime/dart_vm_initializer.cc(40)] Unhandled Exception: type 'Null' is not a subtype of type 'String'
#0 new List.from (dart:core-patch/array_patch.dart:30)
#1 new RemoveControlPayload.fromJson (package:flet/src/protocol/remove_control_payload.dart:7)
#2 appReducer (package:flet/src/reducers.dart:376)
#3 Store._createReduceAndNotify. (package:redux/src/store.dart:235)
#4 Store.dispatch (package:redux/src/store.dart:267)
#5 FletServer._onMessage (package:flet/src/flet_server.dart:265)
#6 FletTcpSocketServerProtocol._onMessage (package:flet/src/flet_server_protocol_tcp_socket.dart:125)
#7 FletTcpSocketServerProtocol.connect. (package:flet/src/flet_server_protocol_tcp_socket.dart:94)
#8 _RootZone.runUnaryGuarded (dart:async/zone.dart:1778)
#9 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:381)
#10 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:312)
#11 _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:798)
#12 _StreamController._add (dart:async/stream_controller.dart:663)
#13 _StreamController.add (dart:async/stream_controller.dart:618)
#14 _Socket._onData (dart:io-patch/socket_patch.dart:2904)
#15 _RootZone.runUnaryGuarded (dart:async/zone.dart:1778)
#16 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:381)
#17 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:312)
#18 _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:798)
#19 _StreamController._add (dart:async/stream_controller.dart:663)
#20 _StreamController.add (dart:async/stream_controller.dart:618)
#21 new _RawSocket. (dart:io-patch/socket_patch.dart:2323)
#22 _NativeSocket.issueReadEvent.issue (dart:io-patch/socket_patch.dart:1646)
#23 _microtaskLoop (dart:async/schedule_microtask.dart:40)
#24 _startMicrotaskLoop (dart:async/schedule_microtask.dart:49)

Description

Test Code

# Test code for the review of this PR

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist

  • I signed the CLA.
  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • New and existing tests pass locally with my changes
  • I have made corresponding changes to the documentation (if applicable)

Screenshots

Additional details

Summary by Sourcery

Bug Fixes:

  • Ensure RemoveControlPayload.fromJson discards null or non-string ids to avoid type 'Null' errors

Ensure the control ids list contains only String values when deserializing from JSON discarding null id values to prevent runtime errors of type:

[ERROR:flutter/runtime/dart_vm_initializer.cc(40)] Unhandled Exception: type 'Null' is not a subtype of type 'String'
                                                                                                    #0      new List.from (dart:core-patch/array_patch.dart:30)
                                                                                                    flet-dev#1      new RemoveControlPayload.fromJson (package:flet/src/protocol/remove_control_payload.dart:7)
                                                                                                    flet-dev#2      appReducer (package:flet/src/reducers.dart:376)
                                                                                                    flet-dev#3      Store._createReduceAndNotify.<anonymous closure> (package:redux/src/store.dart:235)
                                                                                                    flet-dev#4      Store.dispatch (package:redux/src/store.dart:267)
                                                                                                    flet-dev#5      FletServer._onMessage (package:flet/src/flet_server.dart:265)
                                                                                                    flet-dev#6      FletTcpSocketServerProtocol._onMessage (package:flet/src/flet_server_protocol_tcp_socket.dart:125)
                                                                                                    flet-dev#7      FletTcpSocketServerProtocol.connect.<anonymous closure> (package:flet/src/flet_server_protocol_tcp_socket.dart:94)
                                                                                                    flet-dev#8      _RootZone.runUnaryGuarded (dart:async/zone.dart:1778)
                                                                                                    flet-dev#9      _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:381)
                                                                                                    flet-dev#10     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:312)
                                                                                                    flet-dev#11     _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:798)
                                                                                                    flet-dev#12     _StreamController._add (dart:async/stream_controller.dart:663)
                                                                                                    flet-dev#13     _StreamController.add (dart:async/stream_controller.dart:618)
                                                                                                    flet-dev#14     _Socket._onData (dart:io-patch/socket_patch.dart:2904)
                                                                                                    flet-dev#15     _RootZone.runUnaryGuarded (dart:async/zone.dart:1778)
                                                                                                    flet-dev#16     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:381)
                                                                                                    flet-dev#17     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:312)
                                                                                                    flet-dev#18     _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:798)
                                                                                                    flet-dev#19     _StreamController._add (dart:async/stream_controller.dart:663)
                                                                                                    flet-dev#20     _StreamController.add (dart:async/stream_controller.dart:618)
                                                                                                    flet-dev#21     new _RawSocket.<anonymous closure> (dart:io-patch/socket_patch.dart:2323)
                                                                                                    flet-dev#22     _NativeSocket.issueReadEvent.issue (dart:io-patch/socket_patch.dart:1646)
                                                                                                    flet-dev#23     _microtaskLoop (dart:async/schedule_microtask.dart:40)
                                                                                                    flet-dev#24     _startMicrotaskLoop (dart:async/schedule_microtask.dart:49)
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've reviewed this pull request using the Sourcery rules engine

@SIRGPrice
Copy link
Contributor Author

Yesterday's pull request about this was only a partial fix, my fault, this should fix the error completely.

@FeodorFitsner
Copy link
Contributor

Do you have a code to reproduce it or it's sporadic error?

@SIRGPrice
Copy link
Contributor Author

SIRGPrice commented Jun 12, 2025

Do you have a code to reproduce it or it's sporadic error?

In my opinion it is absolutely sporadic, I couldnt recognice any specific section of code or methodology related with the error.

Just to give aditional info: android apk app, latest flet, android studio logcat error, random moment error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants