TiddlyWiki / TiddlyDesktop

A custom desktop browser for TiddlyWiki 5 and TiddlyWiki Classic, based on nw.js
1.72k stars 121 forks source link

Discussion: Detailed description of 259 merge, aiming to solve issue214. #261

Closed Zacharia2 closed 1 year ago

Zacharia2 commented 1 year ago

https://github.com/TiddlyWiki/TiddlyDesktop/pull/259#issuecomment-1321272276

Hi,@Jermolene . I observed that whenever issue #214 comes up, I can AppData\Local\TiddlyDesktop\User Data\Default\user-config-tiddlywiki\tiddlers directory to get two files. These two files are two tiddler filenames, and the filenames are the tiddler titles. because of the length limitation of the filenames only part of them are displayed, I traced the source of these bad titles and found that they come from two calls to the Windowlist.openbyPathName function in mian.js, one listening to the app launch place, and the other is a command variable that is passed to the boot function of tiddlywiki. They both call this openbyPathName function, and I can filter out the pathname parameter in the function. To achieve the effect of bug resolution.

I speculate that the bug is caused by passing the path of a program as the pathname parameter to the openbyPathName function when starting a program when there is already an instance.

And now, after filtering it out, all the problems with issue #214 are gone.

the bad filename feature. is used as part of the bad file name, and filtered out when the file name contains the bad filename feature.

const BadPathNameFeature = '--mixed-context --enable-spell-checking --allow-file-access-from-files';
$_TiddlyDesktop_Config_title_wikifile____D__Software_Z_Extended_TiddlyDesktop-win64-v0.0.15-prerelease.2_nw.exe --mixed-context --enable-spell-checking --allow-file-access-from-files --allow-file-ac.tid

wikifile____D__Software_Z_Extended_TiddlyDesktop-win64-v0.0.15-prerelease.2_nw.exe_ --mixed-context --enable-spell-checking --allow-file-access-from-files --allow-file-access --allow-file-cookies --di.tid
Zacharia2 commented 1 year ago

Do you have a solution that can be improved? Feel free to tell me, thank you.

Zacharia2 commented 1 year ago

If you don't like this merge solution, I will close it, thank you very much.

Jermolene commented 1 year ago

My apologies @Zacharia2 I haven't had time to investigate this, but I think there's an underlying bug in the command line parameter handling. I'd like to merge the changes to the readme in #214, and then I'm hoping that if we fix the command line parameter bug then the other problem will disappear.