Initial RustOpenMLS code #7
Loading…
Reference in a new issue
No description provided.
Delete branch "RustOpenMLS"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Should have all the required functions for a MVP to work.
The public interface is in the
openmls_controls.rsfile and thenetworking.rsfile.Very Baisc RustOpenMLS codeto WIP: Very Baisc RustOpenMLS codeb2823764d8to4ebc0530a7WIP: Very Baisc RustOpenMLS codeto WIP: Basic RustOpenMLS codeI realise now that this is now a very big PR. Should've been split up more and merged as I added things to make it more reviewable. :p
WIP: Basic RustOpenMLS codeto Initial RustOpenMLS codeI've also realised that this doesn't provide a good way for the kotlin side to get location history unless it stores it itself, which I believe we decided against.
Storing in a new location history table can work but then your friends locations are stored unencrypted. I'll look into how to get openMLS message history.
Few minor things but looks awesome !!
@ -0,0 +27,4 @@self_expected == other_expected && self_actual == other_actual}// close enoughSelf::SerdeCborError(_) => true,you're so funny <3
@ -0,0 +27,4 @@user_id: String,user_password: String,) -> Result<Self, AppError> {let db = AppStorage::from_path(&path)?;If you're panicking in some places anyway, why are you returning standard results anywhere?
I decided the distinction was, "can the kotlin side actually do anything by having this error as a value". So with that , the kotlin side could like adjust the path it makes the file ig. ehh the reasoning isn't that great, i should probably just make locking the mutex also return an error as value cause it's easy to do and removes
.expect()calls. I mean, at the point where the db mutex gets poisoned, there is nothing the kotlin side can do except restart itself because that means something has gone very wrong. I'll do it anywayy :p@ -0,0 +47,4 @@})}/// blocks indefinitelyit shouldn't; everything should be called one n done from kotlin
should be resolved now!
@ -0,0 +34,4 @@assert!(path.starts_with("https://"));if !path.ends_with("/") {path.push('/');If you use the Reqwest URL type, you needn't verify the path's validity urself. Also we just get a tighter definition of what everything is, as lycanea loves to say
ooa, i didn't know about that, ill use it.
omg it's just reexport of url crate okie dokie, i thought about using it but didnt want to add another dependency if it wasnt needed, but if it's already included I will.
@ -0,0 +49,4 @@/// blocks indefinitelypub async fn run(&self) -> Result<(), AppError> {let _ = self.create_account_if_does_not_exist().await?;I feel like the client should know indefinitely that it has been registered; sending a request every time feels kinda unnecessary and en masse it's one extra request per client per period of time
further on this: should the kotlin side pass the rust side info like location or should rust side collect it? either way, it needs to know all the people to send stuff to, and what level of info to give each person
First part should be resolved now, kotlin should pass location to rust side.
I'll work on setting up a permission system and things after this is merged in, in a separate MR.
@ -0,0 +56,4 @@let messages = db.pop_message_queue()?;SendRequests(messages)};I like this, very stylish
@ -0,0 +75,4 @@let deserialzied: PollResponse = serde_cbor::from_slice(&bytes)?;// hope this isn't expensive ...let out = deserialziedtypo
@ -0,0 +139,4 @@"got unauthorised send message response. {:#?}",response))),reqwest::StatusCode::INTERNAL_SERVER_ERROR => Err(Self::server_error(response).await),should we consider retrying on an error 500? Not sure what the appropriate handling of this is, cus we can't really just post an error to the user on background tasks.
I tried doing request retrying with this function
but that resulted in this mysterious error.
(enabling macro backtrace is no more useful)
so idk i could do it some other way or whatever, but idk i think telling the user, via like a notification or smth, "hey we tried to talk to the ds and it returned a 500. Contact the server administrator" is fine
yaya oki this works
35deb1641fto944eba0bfb585b4f4b8cto6dfccdbfc9@ -80,6 +80,15 @@ impl AppStorage {)}pub fn get_all_known_uuids(&self) -> Result<Vec<String>, rusqlite::Error> {Instead of just returning UUIDs, there should be a way to get all users as user structs
@ -12,3 +12,3 @@* Docs for the specific kotlin plugin we use: https://docs.oxikt.dev/** A few things to note.* A few things to note.This is a major change and I think we need to have a real and serious discussion before we proceed with adding something like this to a pr
just needs the get all user structs method n we're good :>
YAYYYY
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.