-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MWS: Async rewrite #8887
Closed
Closed
MWS: Async rewrite #8887
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…rchive The archive format is a legacy format that I used with Xememex, and will need to be updated to iron out the wrinkles
This is the start of adding support for large attachments. We have a new endpoint for POSTing tiddler data. The idea is that it will take any kind of data and figure out how to extract tiddlers from the upload and save them in the nominated bag. The next step is to move the attachment files into a special folder and reference them from the database so that we can construct _canonical_uris for them.
To make us more tolerant of proxies that "helpfully" decodeuricomponent for us (looking at you Azure)
…yWiki#7996) * Switch from better-sqlite3 to node-sqlite3-wasm Seems to be slower, but might make cloud deployments easier by not having any binary dependencies * More logging * Temporarily use a memory database We will make this configurable * Revert "More logging" * Resume loading demo tiddlers * Cache prepared statements Gives a 20% reduction in startup time on my machine * Some more logging * Update package-lock * More logging * Route regexps should allow for proxies that automatically decode URLs Astonishingly, Azure does this * Go back to a file-based database * Less logging * Update package-lock.json * Simplify startup by not loading the docs edition * Tiddler database layer should mark statements as having been removed * Re-introduce better-sqlite3 * Make the SQLite provider be switchable * Support switchable SQL engines I am not intending to make this a long term feature. We will choose one engine and stick with it until we choose to change to another. * Adjust dependency versions * Setting up default engine * Make transaction handling compatible with node-sqlite3-wasm https://github.com/tndrle/node-sqlite3-wasm doesn't have transaction support so I've tried to implement it using SQL statements directly. @hoelzro do you think this is right? Should we be rolling back the transaction in the finally clause? It would be nice to have tests in this area... I looked at better-sqlite3's implementation - https://github.com/WiseLibs/better-sqlite3/blob/master/lib/methods/transaction.js * Default to better-sqlite3 for compatibility after merging
@linonetwo the resulting archive should be suitable for storing in git
I think this was introduced in TiddlyWiki#8455 sorry it took me so long to notice
* TiddlyWiki#8812 resolve issue with anonymous access * TiddlyWiki#8812 bug fix with anonymous access
… admin account setup (TiddlyWiki#8847)
* TiddlyWiki#8854 fix acl error in anon mode * TiddlyWiki#8854 fix test failure
Available in Node.js 22.50 - see https://nodejs.org/api/sqlite.html Given the Node.js release timeline, I think it will be reasonable to switch to the integrated Node.js sqlite as the default, which will avoid all the npm install kerfuffle too.
Confirmed: Arlen22 has already signed the Contributor License Agreement (see contributing.md) |
❌ Deploy Preview for tiddlywiki-previews failed.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
It was kind of fun. This took me about 12 hours, not counting interruptions.
It's not much of a rewrite, more just converting every database call (and everything upstream of every database call) to async/await.
If you haven't used VSCode, you're definitely going to want to explore the code using it to fully appreciate the little improvements that typing can bring.
I'm still working out a few bugs surrounding the somewhat confusing authenticatedUser property. But I'm too tired and I need to get some sleep and take a fresh look at it later.