Giter VIP home page Giter VIP logo

Comments (4)

 avatar commented on August 29, 2024

Workaround (Failed)

Add the following function to `ipfshost.js', and call it from https://github.com/trufflesuite/ethpm-js/blob/master/lib/preflight.js#L43

This is the only dependency-file fetched during the tests, so test go through fine. Still, the sporadic test failure happens.

IPFSHost.prototype.getDummy = function(uri) {
  var self = this;
  console.log('->ipfs.getDummy');

  return new Promise(function(accept, reject) {
    if (uri.indexOf("ipfs://") != 0) {
      return reject(new Error("Don't know how to resolve URI " + uri));
    }

content = `
{
  "lockfile_version": "1",
  "version": "1.0.0",
  "package_name": "owned",
  "meta": {
    "license": "MIT",
    "authors": [
      "Piper Merriam <[email protected]>"
    ],
    "description": "Reusable contracts which implement a privileged'owner' model for authorization",
    "keywords": [
      "authorization"
    ],
    "links": {
      "documentation": "ipfs://QmQiqrwqdav5bV8mtv4PqGksGcDWo43f7PAZYwhJqNEv2j"
    }
  },
  "sources": {
    "./contracts/owned.sol": "ipfs://QmUjYUcX9kLv2FQH8nwc3RLLXtU3Yv5XFpvEjFcAKXB6xD"
  }
}
`;

  accept(content);
    
  });
};

from truffle-core.

 avatar commented on August 29, 2024

Next step is to disable all ipfs access, just to be sure (although there is strong indication that Preflight.resolve_dependencies code triggers the sporadic time-out, but only if an dependency is found)

from truffle-core.

 avatar commented on August 29, 2024

I've provided an ipfs.getDummy, which bypasses ipfs reads completely. But the sporadic error insists.

The package transferable is usually requested with the id

ipfs://QmNiYhxqk9h1YrKEebasLHRcA8UZVLqbvh1fDTpFyq5Lyi

when the error happens, transferable is requested with the id:

ipfs://QmZYLL7utWBz9v4nzFsTenKatFRDEsXgTFwHpiy6ADSmHt

This would mean that the error happens when the ipfs-stuff is created pre-test. Or something similar strange (possibly a twisted index).

(will confirm this tomorrow, that 18hours bug-hunting thing today was really too much)

from truffle-core.

 avatar commented on August 29, 2024

Fresh brain, added the following to the ipfs.getDummy

if (uri === "ipfs://QmZYLL7utWBz9v4nzFsTenKatFRDEsXgTFwHpiy6ADSmHt") {
  uri = "ipfs://QmNiYhxqk9h1YrKEebasLHRcA8UZVLqbvh1fDTpFyq5Lyi";
  console.log('  #### SPORADIC ERROR CORRECTED ####');
}

which results in this fine debug output:

->ipfs.getDummy: ipfs://QmZYLL7utWBz9v4nzFsTenKatFRDEsXgTFwHpiy6ADSmHt
  #### SPORADIC ERROR CORRECTED ####
->ipfs.getDummy: ipfs://QmZ6Zg1iEejuJ18LFczowe7dyaxXm4KC4xTgnCkqwJZmAp
->ipfs.getDummy: ipfs://QmZYLL7utWBz9v4nzFsTenKatFRDEsXgTFwHpiy6ADSmHt
  #### SPORADIC ERROR CORRECTED ####

And in passing tests.

The relevant dummy code is here: IPFSgetDummy.js

At this point, debugging becomes much easier (IDE supported debugging), so this SPERR-hunt should be over soon.

One bad news though: another one very very rare sporadic error directly related to ipfs exists (which is possibly windows related). Should be looked into, too.

from truffle-core.

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.