Closed 4c656554 closed 2 years ago
Thank you for reporting this, I haven't come across it before. 😅
Would you be able to create a minimal repo that reproduces this issue to help debug?
Will do
Finally done :-)
I've found that editing the XSalsa20
code as follows (line ~72712 in hypersdk bundle) removes the error. However it still seems to wheel spin and not transfer the larger files:
,{"xsalsa20":573}],573:[function(require,module,exports){
var xsalsa20 = require("./xsalsa20")();
var SIGMA = new Uint8Array([101, 120, 112, 97, 110, 100, 32, 51, 50, 45, 98, 121, 116, 101, 32, 107]);
var head = 144;
var top = head;
var free = [];
module.exports = XSalsa20;
XSalsa20.NONCEBYTES = 24;
XSalsa20.KEYBYTES = 32;
XSalsa20.core_hsalsa20 = core_hsalsa20;
XSalsa20.SIGMA = SIGMA;
let salsaNonce = null;
let salsaKey = null;
function XSalsa20(nonce, key) {
if (!(this instanceof XSalsa20)) return new XSalsa20(nonce, key);
if (!nonce || nonce.length < 24) throw new Error('nonce must be at least 24 bytes');
if (!key || key.length < 32) throw new Error('key must be at least 32 bytes');
salsaNonce = nonce;
salsaKey = key
this._xor = xsalsa20 && xsalsa20.exports ? new WASM(nonce, key) : new Fallback(nonce, key);
console.log('XSalsa20 called',"this:",this,"this._xor:",this._xor)
}
XSalsa20.prototype.update = function (input, output) {
if (!input) throw new Error('input must be Uint8Array or Buffer');
if (!output) output = new Uint8Array(input.length);
if(!this._xor) this._xor = xsalsa20 && xsalsa20.exports ? new WASM(salsaNonce, salsaKey) : new Fallback(salsaNonce, salsaKey)
console.log('_xor?',"this:",this,"this._xor:",this._xor,"input:",input,"output:", output,"nonce,key",salsaNonce, salsaKey)
if (input.length) this._xor.update(input, output);
return output;
};
The maximum file size I'm able to transfer is <450kB
Is this still an issue? I haven't done any large file tests lately.
I don't know, I plan to come back to it at some point but have no time estimate atm.
The changes here might have also helped.
I just re checked this, open the above debug check from links below, if you'd like to verify:
https://ooda.space/hypersdk_debug/hypersdk_debug_A.html
and
https://ooda.space/hypersdk_debug/hypersdk_debug_B.html
The error doesn't appear, so I'd go ahead and close it - Thank you!
Glad that's sorted out! 😁 Thank you for the follow up.
My setup.
Two chrome based browsers (1. Ubuntu 18.04.5, 2. Win10)
A website that loads browserified hyper-sdk (from this repo)
A Node server running hyperswarm-web proxy and signal servers (used by hyper-sdk)
I can set up and read small text snippets:
e.g. Computer 1:
Computer 2:
I attempting to read the large file I get the following error, on the console of computer 1.
I will continue to investigate, but posting here in case anyone can recognise what is going wrong.
Thanks