Tiddloid
Tiddloid copied to clipboard
Saving tiddlywiki does not overwrite the whole file
The last 30 lines in my tiddlywiki file:
/////////////////////////// Autoboot in the browser
if($tw.browser && !$tw.boot.suppressBoot) {
$tw.boot.boot();
}
return $tw;
});
if(typeof(exports) !== "undefined") {
exports.TiddlyWiki = _boot;
} else {
_boot(window.$tw);
}
</script>
</div>
<!--~~ Raw markup for the bottom of the body section ~~-->
</body>
</html>
lyWiki = _boot;
} else {
_boot(window.$tw);
}
</script>
</div>
<!--~~ Raw markup for the bottom of the body section ~~-->
</body>
</html>
As you can see some ten lines from the old tiddlywiki file remain in the newly saved file. This happens sometimes when the to be saved tiddlywiki becomes smaller than the original. Perhaps the old file should be truncated first before being overwritten?
I get something similar occurring with this code left over in the main window:
html> yptedTiddlers(function() { // Startup $tw.boot.startup({callback: callback}); }); }; /////////////////////////// Autoboot in the browser if($tw.browser && !$tw.boot.suppressBoot) { $tw.boot.boot(); } return $tw; }); if(typeof(exports) !== "undefined") { exports.TiddlyWiki = _boot; } else { _boot(window.$tw); }
This has happened after moving phones from Android 8 to Android 11. Will this cause any problems?
P.S. Ive switched back to AndTidWiki which currently seems to be working OK
I get something similar occurring with this code left over in the main window:
html> yptedTiddlers(function() { // Startup $tw.boot.startup({callback: callback}); }); }; /////////////////////////// Autoboot in the browser if($tw.browser && !$tw.boot.suppressBoot) { $tw.boot.boot(); } return $tw; }); if(typeof(exports) !== "undefined") { exports.TiddlyWiki = _boot; } else { _boot(window.$tw); }
This has happened after moving phones from Android 8 to Android 11. Will this cause any problems?
I have no idea :( In theory it will prompt a failure if the file is corrupted. And nothing's wrong on my non-android-11 AVDs and my own phone (8.1). I hav asked a question about this on stackoverflow. Good luck to me :(
P.S. Ive switched back to AndTidWiki which currently seems to be working OK
I get something similar occurring with this code left over in the main window:
html> yptedTiddlers(function() { // Startup $tw.boot.startup({callback: callback}); }); }; /////////////////////////// Autoboot in the browser if($tw.browser && !$tw.boot.suppressBoot) { $tw.boot.boot(); } return $tw; }); if(typeof(exports) !== "undefined") { exports.TiddlyWiki = _boot; } else { _boot(window.$tw); }
This has happened after moving phones from Android 8 to Android 11. Will this cause any problems?
BTW it seems that legacy mode is still working. Maybe it's time to find an old file manager... (:з」∠)
As this is my "live" TW I was concerned it might corrupt it. There is no evidence that this has happened, other than the code in the main window, but I wanted to be cautious.
What is legacy mode?
The legacy mode uses file:// uris, which is being deprecated by google ,requiring storage permissions. This is to keep compatibility to 1.x wikis. To add a new wiki in legacy mode, you need to find an old file manager(targeting android version <4.4), which uses file:// to open files. Then you can choose Tiddloid here to add the file.
BTW andtidwiki also uses file://, which is used with java file api, aged but relyable.
Ah, I understand. As AndTidWiki has a default directory I was able to copy my TW there and then open it which solved the problem
Are you using cloud services that support WebDAV? Now you can checkout the latest 2.2.0-pre version here (This is a pre-release with a debug package)
I've been using rclone serve webdav .
on my pc, but I'll try your prerelease later.
Debug package does not install: "App not installed as package appears to be invalid."
我今天也遇到这个了,不过笔记还是可以正常使用 ,对我同步回桌面板也没啥影响
Very large amount of code shown after saving a brand new wiki after only adding two tiddlers.
Has no impact on usability but is concerning
Applied some tricks to the app. Now it'll decode the file ahead-of-time if on Android 11+ and using SAF, and try to remove all contents behind the first </html>\n
, which is rendered as some kinds of codes in viewer. The actual file won't be shrinked though, until the file become larger than before.
Ok where is the commit?
Not pushed yet XD
Update: Android 10 is also affected. My Android 10 AVD is wonky and missing random characters on any interfaces so I didn't notice the issue the past days. Sorry :(
The patch is modified to include Android 9 / 10. Saving a corrupted file on Android 9 can cease the corruption.
Applied some tricks to the app. Now it'll decode the file ahead-of-time if on Android 11+ and using SAF, and try to remove all contents behind the first
</html>\n
, which is rendered as some kinds of codes in viewer. The actual file won't be shrinked though, until the file become larger than before.
Please take a look at the answers on stackoverflow for this (https://stackoverflow.com/questions/56902845/how-to-properly-overwrite-content-of-file-using-android-storage-access-framework), it fixes a similar issue and involves truncating the file prior to writing, I'm not confident that your approach of checking up to the first </html>\n
would properly fix this issue.
Also take a look at https://issuetracker.google.com/issues/180526528 for further details.
Okay I uploaded 2.3.0 to GitHub/Gitee/CoolApk (F-droid version needs some time to be built). Try it and let me know if it ceased your problem.
Does anyone still have problem with 2.3.0 or later? I may close this if no problem reported.
no
No more bug reports since 2.3.0. Closing this. Reopen it if you're still concerned.