solid-panes icon indicating copy to clipboard operation
solid-panes copied to clipboard

Unable to create new link

Open melvincarvalho opened this issue 6 years ago • 4 comments

Summary

When clicking the green plus button and adding a Link, after entering the name, an error is thrown without a new link being created.

Console Output

create.js:78 Uncaught (in promise) Error: Cannot mint new - missing newInstance at create.js:78 at

Screenshot

newlink

melvincarvalho avatar Mar 13 '18 08:03 melvincarvalho

More Debug

newThingUI: Minting new link at https://melvin.localhost:9999/public/link/

Source code : https://github.com/linkeddata/solid-ui/blob/master/src/create.js#L77

melvincarvalho avatar Mar 13 '18 08:03 melvincarvalho

Same problem here

ghost avatar Sep 30 '18 03:09 ghost

Now when I create a link, it doesnt give an error.

But it makes a new meeting, which unexpected.

melvincarvalho avatar Oct 09 '18 22:10 melvincarvalho

Also getting the same issue (on solid.community)

link-generation-issue-solid

Update: So I just spent an hour or so in chrome debugger following the code.

Like you said @melvincarvalho the issue is this if statement screen shot 2018-10-12 at 1 12 02 am

If you trace it back to the mintNew, the mintNew in linksPane.js function does not add newInstance to it. The previous newPaneOptions[op] = options[op] that gets done above does not have newInstance on it. The original ops set as well

screen shot 2018-10-12 at 1 12 36 am

Does not have it either. However, the interesting thing is that it fails here because the very next if statement after the if check and it throws the error is

screen shot 2018-10-12 at 1 13 18 am

Now newPaneOptions does contain the folder property and its valid in the debugger so it would never hit the else check in this scenario and cause an error. My guess is that the newInstance property gets added once you add the link target to the newly created link or whatever its supposed to do (new to this, never seen the next step in adding a link).

My proposed solution (just taking a stab at it) is that the!newPaneOptions.newInstance check before it should only be checked if its passed that next step (giving it an actual link target) because there is no actual instance created yet. So no matter what its ALWAYS going to fail there because it hasnt progressed far enough in the link adding process to be warranted for that check.

If you need me to explain any of that further let me know. I'll see if I get some free time this weekend to pull this project down and try implementing a fix. Still wading through a lot of this project as I have just found it recently.

btassone avatar Oct 12 '18 04:10 btassone