Skip to content

json-as Native Messaging host fails to parse/process greater than 1 MiB of Array containing null #191

@guest271314

Description

@guest271314

This https://github.com/JairusSW/native-messaging-assemblyscript/blob/main/nm_assemblyscript_json_as.ts doesn't work.

Expected result is for the host to send back up to 1 MiB to the client per message when more than 1 MiB, up to 64 MiB, is posted to host, Using json-as, if 1 byte more than 1 MiB is posted to the host, nothing else happens...

Steps to reproduce

var n = 0;
var data = Array(209715+1); // Array(209715*64)
var port = chrome.runtime.connectNative("nm_assemblyscript");
port.onMessage.addListener((message) => {
  n += message.length;
  console.log(message);
  if (n === data.length) {
    console.log({ n });
    n = 0;
  }
});
port.onDisconnect.addListener((_) => {
  console.log("Disconnected");
  if (chrome.runtime.lastError) {
    console.log(chrome.runtime.lastError);
  }
});
port.postMessage(data);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions