NoteSelf / NoteSelf.github.io

Home page of the project
Other
125 stars 18 forks source link

Loop on loading message from online #34

Closed guiguid closed 6 years ago

guiguid commented 7 years ago

with

Something went wrong during plugin injection  Object { status: 404, name: "not_found", message: "missing", error: true, reason: "missing", stack: "" }  online:272:13
Something went wrong booting tiddlywiki  TypeError: $tw.boot.boot is not a function
Trace de la pile :
@https://noteself.github.io/online/:275:17
  online:277:17
TypeError: can't access dead object  tab.js:1658:1
Something went wrong during plugin injection  Object { status: 404, name: "not_found", message: "missing", error: true, reason: "missing", stack: "" }  online:272:13
Something went wrong booting tiddlywiki  TypeError: $tw.boot.boot is not a function
Trace de la pile :
@https://noteself.github.io/online/:275:17
  online:277:17
TypeError: can't access dead object  tab.js:1658:1
Something went wrong during plugin injection  Object { status: 404, name: "not_found", message: "missing", error: true, reason: "missing", stack: "" }  online:272:13
Something went wrong booting tiddlywiki  TypeError: $tw.boot.boot is not a function
Trace de la pile :
@https://noteself.github.io/online/:275:17
  online:277:17
TypeError: can't access dead object  tab.js:1658:1
Something went wrong during plugin injection  Object { status: 404, name: "not_found", message: "missing", error: true, reason: "missing", stack: "" }  online:272:13
Something went wrong booting tiddlywiki  TypeError: $tw.boot.boot is not a function
Trace de la pile :
@https://noteself.github.io/online/:275:17
  online:277:17
TypeError: can't access dead object  tab.js:1658:1
Something went wrong during plugin injection  Object { status: 404, name: "not_found", message: "missing", error: true, reason: "missing", stack: "" }  online:272:13
Something went wrong booting tiddlywiki  TypeError: $tw.boot.boot is not a function
Trace de la pile :
@https://noteself.github.io/online/:275:17
  online:277:17
TypeError: can't access dead object  tab.js:1658:1
Something went wrong during plugin injection  Object { status: 404, name: "not_found", message: "missing", error: true, reason: "missing", stack: "" }  online:272:13
Something went wrong booting tiddlywiki  TypeError: $tw.boot.boot is not a function
Trace de la pile :
@https://noteself.github.io/online/:275:17

with

URL: https://noteself.github.io/online/ [Error] Something went wrong booting tiddlywiki at line 277 URL: https://noteself.github.io/online/ [Info] Something went wrong during plugin injection at line 272

guiguid commented 7 years ago

If I save the online version locally, it works fine. So the endless flicking is related to early javascript execution when the page isn't fully loaded by the browser.

rmu75 commented 6 years ago

I also experience an endless loop on one computer, it loads fine on the other machines. Using the debugger, when execution is stopped and continued, it usually loads fine. Seems to be some kind of timing- or multi-threading issue. The computer where it fails reproducibly has an 8 threads skylake i7, the working machines have lesser CPUs from older generations with at most 4 threads. Affected browser is firefox 55, it seems to work most of the time in chrome. System is ubuntu up-to-date ubuntu 16.04. I did not test any other browsers.

JokerQyou commented 6 years ago

Happens for Chrome 62.0.3202.94 on macOS. The Javascript stack trace is:

(index):280 Something went wrong booting tiddlywiki  TypeError: $tw.boot.boot is not a function
    at (index):278
    at <anonymous>
(anonymous) @ (index):280
Promise resolved (async)
(anonymous) @ (index):276
(anonymous) @ (index):288

and the source code:

.then(function(){
  try{
    $tw.boot.boot(); // boot when chain completes, even if we got some errors
  }catch(err){
    console.error('Something went wrong booting tiddlywiki ',err);
    window.location.reload();
  }
})

By inspecting the $tw object, there clearly is no function named $tw.boot.boot:

> $tw
{boot: {suppressBoot: true}}

I suppose that's because the <script> block at line ~128 executes before the code at line ~11457 (where $tw.boot.boot is defined).

I tried to debug this, but I can't really debug a single HTML file with thousands of lines of Javascript... And I did not find any source code or build manual of the online version. So I have to give up. It's strange that the offline version works offline, but once you upload it to a server and start using it online, the same problem pops up.

Wish I could use this, as it looks quite good based on what the website says. 😢

danielo515 commented 6 years ago

Hello @JokerQyou,

Thank you very much for your breakdown and I'm sorry about your inconvenience. This is clearly a timing issue regarding code load. What I don't understand is why it just happens from time to time to some people and all the time to other persons.

The online version has a github repository, which is this one, but it only contains the code specific for NoteSelf. Due to the modular nature of TW, NoteSelf is composed of several plugins. The code you are debugging (if you want to take a look) is on my TiddlyPouch repository, specifically here:

https://github.com/danielo515/tiddlypouch/blob/develop/src/plugins/danielo515/tiddlypouch/boot/boot.html.tid

I think the best solution will be to just prompt a message to the user and kindly ask to reload the browser. In any case, this issue is at the top of my to-do list

Regards

danielo515 commented 6 years ago

I just published a small change that at least does not trigger a refresh loop. Maybe refreshing manually when this happens stops the problem at some point. I don't have much hope, but let's see.

danielo515 commented 6 years ago

Another update. I just published a new version that I think solves the issue. The problem (as many have pointed out) is that TW seems to not boot at the point that TiddlyPouch has finished booting. Now instead of forcing TW to boot we just allow it to boot however it needs.

You may need to reload a couple of times until the cache is refreshed. Since this problem does not happen to me if any of you can test it out and report if it works I'll be very grateful.

Regards

JokerQyou commented 6 years ago

Thanks! I've tested and it works on my Windows 10 machine with Chrome 63. I'll test it on a macOS machine tonight.

Update: just tested and it works in Chrome on macOS now.

guiguid commented 6 years ago

Nice, it works for me : FireFox 58 on linux. Thanks !