Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Browser: Reloading page with static repoName throws error #773

Closed
@aphelionz

Description

@aphelionz

Steps to reproduce:

Run this code in the browser to connect to a repo with a static name. In this case "pastebin"

const repoName = "pastebin";

let ipfs = new Ipfs({
  repo: repoName,
  EXPERIMENTAL: {
    pubsub: false
  }
});
 
const startApp = (err) => {
  if(err) throw err;
  console.log("good to go")
};

const goOnline = () => ipfs.goOnline(startApp);
const loadIpfs = () => ipfs.load(goOnline);

ipfs.init({ emptyRepo: true, bits: 2048 }, loadIpfs);

Expected Behavior: console should log "good to go" every time
Actual Behavior: the console logs "good to go" the first time, and throws the error the second time

This is related to IndexedDB. It seems ipfs.init doesn't like existing repos.

It also seems that emptyRepo has no effect, as this error occurs when it is true or false. Upon further inspection emptyRepo is used to "seed" the database with the initial blocks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions