Coder Social home page Coder Social logo

Comments (6)

remoteportal avatar remoteportal commented on June 10, 2024 1

I talked to the Dart team and they are convinced it's a bug in mysql1.

I don't understand how it's so transient... I run it one time and it fails... then, run it a minute later and it succeeds.

from mysql1_dart.

victorruandev avatar victorruandev commented on June 10, 2024 1

I'm with the same error, but in another context. I'm using msix for generate a installer (MSI) where I need to do a certificate (using SSL). Follow the erro itself:
flutter pub run msix:create
running "flutter build windows"... 113.8s
building msix files... \Unhandled exception:
FormatException: Missing extension byte (at offset 45)
#0 _Utf8Decoder.convertChunked (dart:convert-patch/convert_patch.dart:1859:7)
#1 _Utf8ConversionSink.addSlice (dart:convert/string_conversion.dart:314:28)
#2 _Utf8ConversionSink.add (dart:convert/string_conversion.dart:310:5)
#3 _ConverterStreamEventSink.add (dart:convert/chunked_conversion.dart:72:18)
#4 _SinkTransformerStreamSubscription._handleData (dart:async/stream_transformers.dart:111:24)
#5 _RootZone.runUnaryGuarded (dart:async/zone.dart:1618:10)
#6 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341:11)
#7 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
#8 _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:774:19)
#9 _StreamController._add (dart:async/stream_controller.dart:648:7)
#10 _StreamController.add (dart:async/stream_controller.dart:596:5)
#11 _Socket._onData (dart:io-patch/socket_patch.dart:2314:41)
#12 _RootZone.runUnaryGuarded (dart:async/zone.dart:1618:10)
#13 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341:11)
#14 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
#15 _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:774:19)
#16 _StreamController._add (dart:async/stream_controller.dart:648:7)
#17 _StreamController.add (dart:async/stream_controller.dart:596:5)
#18 new _RawSocket. (dart:io-patch/socket_patch.dart:1839:33)
#19 _NativeSocket.issueReadEvent.issue (dart:io-patch/socket_patch.dart:1322:14)
#20 _microtaskLoop (dart:async/schedule_microtask.dart:40:21)
#21 _startMicrotaskLoop (dart:async/schedule_microtask.dart:49:5)
#22 _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:122:13)
#23 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:193:5)
pub finished with exit code 255

from mysql1_dart.

remoteportal avatar remoteportal commented on June 10, 2024
  String readString(int length) {
    var s = utf8.decode(_list.sublist(_readPos, _readPos + length));     <= HERE
    _readPos += length;
    return s;
}

from mysql1_dart.

remoteportal avatar remoteportal commented on June 10, 2024

I don't understand your code, but it's dying in the decode routine, that does this:

Converts the UTF-8 codeUnits (a list of unsigned 8-bit integers) to the corresponding string

https://api.dart.dev/stable/2.10.0/dart-convert/Utf8Decoder/convert.html

But the FUNNY thing is that my table doesn't even have any strings!!!

  `symID` smallint(4) unsigned not null,
  `qs` smallint(5) unsigned not null,
  `open` decimal(8,2) unsigned default null,
  `high` decimal(8,2) unsigned default null,
  `low` decimal(8,2) unsigned default null,
  `lp` decimal(8,2) unsigned default null,
  `v` int(8) unsigned default null,
  primary key (symID, qs)

from mysql1_dart.

remoteportal avatar remoteportal commented on June 10, 2024
 /// Converts the UTF-8 [codeUnits] (a list of unsigned 8-bit integers) to the
  /// corresponding string.
  ///
  /// Uses the code units from [start] to, but no including, [end].
  /// If [end] is omitted, it defaults to `codeUnits.length`.
  ///
  /// If the [codeUnits] start with the encoding of a
  /// [unicodeBomCharacterRune], that character is discarded.
  String convert(List<int> codeUnits, [int start = 0, int? end]) {
    // Allow the implementation to intercept and specialize based on the type
    // of codeUnits.
    var result = _convertIntercepted(_allowMalformed, codeUnits, start, end);
    if (result != null) {
      return result;
    }

    return _Utf8Decoder(_allowMalformed).convertSingle(codeUnits, start, end);        <====HERE
  }

from mysql1_dart.

adamlofts avatar adamlofts commented on June 10, 2024

There are plenty of places where we are reading a string and assuming it is utf8 when it is not specified in the docs. I've updated the code to soften this assumption.

Can you try running with the master branch.

from mysql1_dart.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.