-
Notifications
You must be signed in to change notification settings - Fork 0
Support 2.1.53 desktop version #2
Support 2.1.53 desktop version #2
Conversation
We add sqlite.proto and define interfaces to access this from rslib-bridge (cherry picked from commit 6d5d150)
This works for all but open/closeBackend. This is because we currently return raw values rather than protobuf byte streams. This is WIP as the Rust could be implemented better - possibly a macro A function was attempted and should be tried again with a single lambda Multiple parameters made execution significantly slower. But, learning how to do macros can wait until the library is released. (cherry picked from commit 8cb83f4)
The anki crate should expose these as features in the future.
Please hold off on merging this until I have a chance to fix a Windows/Mac issue with the protobuf files. |
- Reuses existing protobuf infrastructure to greatly cut down on the JNI boilerplate - Ensures all calls have errors handled, and happen behind a mutex - Removes separate downgrade + open11 calls in favour of a flag to the standard collection opening routine - Various code cleanups
Should be good to go now; all tests are passing in the -Backend repo. |
Just agreeing with the mechanical / source integration comment here, preliminarily:
The rest seems like deciding where to move the dirt under the rug, and I have a default position of agreeing with you as rust lib owner and following "implementor's choice" bias, but I want to review to make sure of course |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's my sincere hope to have as much of this as possible upstream-ed but this is already an improvement structurally as a sort of git branch-extension off the upstream tag. Not too hard to follow
I've done a branch here on our fork at your upstream 2.1.53 tag, re-targeted this PR to point to it and that should be how to do it unless my git-fu fails me
Posting this for reference; recommend you pull it into an ankidroid-2.1.53 branch instead of main, which a new -Backend PR can then consume.
This reworks David's previous AnkiDroid-specific changes to work with the latest desktop code, and moves most of the additional Rust code from the -Backend repo into a patch on rslib. This greatly cuts down on the JNI boilerplate, and improves error handling. Most of the additional code is in separate files, so conflicts when rebasing over newer Anki versions should be fairly rare.