Skip to content
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

release: use 24.11rc1 (locally, add SYNC_SERVER_MESSAGE handling) #439

Merged
merged 1 commit into from
Nov 9, 2024

Conversation

mikehardy
Copy link
Member

Adopts the new upstream version, with the locally-interesting change being the split-out handling of new SYNC_SERVER_MESSAGE

I...think I did that correctly? Extra eyes + strict review keenly desired

@@ -8,7 +8,6 @@ use std::env;
use std::env::consts::OS;
use std::fs;
use std::io::{self, Write};
use std::ops::Deref;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unused import likely from earlier changes and dev iterations on typescript binding listing, I just threw this in there both "for free" and to confuse you about why it's in there. Thus this comment.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💀 fair enough

@@ -19,7 +19,7 @@ android.useAndroidX=true
android.enableJetifier=false

GROUP=io.github.david-allison
VERSION_NAME=0.1.46-anki24.10rc2
VERSION_NAME=0.1.47-anki24.11rc1
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bumped local number since this won't be cross-compatible with prior versions of anki etc as there were local changes

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mvn central status seems green

Copy link
Member

@david-allison david-allison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got a headache, review may not be fully thought through.

The question is "what we want to do with the exception?"

I feel we want to special-case the 'revalidate' at the very least:

  • We want the dialog to have a button to open up AnkiWeb
  • We want the user's email as a parameter to the exception

So we want to change ServerMessage(error) into an exception builder, in the same way that BackendDbException.fromDbError works


ExceptionTest should include the new exception

@dae
Copy link
Contributor

dae commented Nov 8, 2024

Server messages are arbitrary text. If you want to handle a specific sub-case in a non-fragile way, it's going to require reworking the sync protocol to return a specific flag or error code instead of the message.

@mikehardy
Copy link
Member Author

Based on current 2 server messages like this - reconfirm email + agree to Ts&Cs - I think (@dae please correct if wrong) a server message could be handled by just showing it to the user? Maybe with an optional "open ankiweb.net directly" button since that appears to be the typical need?

And then don't log it anywhere of course :-)

In that case, just having it cased here so we can do that seems sufficient?

@dae
Copy link
Contributor

dae commented Nov 8, 2024

Yep, they're intended to be directly shown to the user and not parsed by the client, and there's more than 2, e.g:

        SyncMessage::AnkiDroid29Required =>
            "Syncing failed. Please update your AnkiDroid to 2.9 or later.".into()

By keeping them as strings, it allows new error cases to be introduced without a client upgrade.

@mikehardy
Copy link
Member Author

That makes sense, thanks.

So KISS principle is just show them to the user, and that means that we don't need anything fancier in this repo than the typing here, which is what I believe this PR does

I still like the idea of an "open ankiweb" type UI element but the wording will need to be carefully considered since it needs to contain the idea "hey, this may help but also it may not be relevant at all". Tough wording challenge but a minor point really

Copy link
Member

@david-allison david-allison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think my comment on the test case on ExceptionTest still stands

But this is important and testing isn't a blocker. Merge at will

@mikehardy mikehardy force-pushed the 24.11rc1-sync-server-message branch from 1701b38 to e73cfcd Compare November 8, 2024 23:50
@mikehardy
Copy link
Member Author

ExceptionTest should include the new exception

Sorry! skipped past that - just missed it

Just re-pushed with the addition of that exception type to the test - did I do that correctly? I'm not sure what exactly that exercises to be honest 🤔

@david-allison david-allison merged commit db41831 into main Nov 9, 2024
6 checks passed
@david-allison david-allison deleted the 24.11rc1-sync-server-message branch November 9, 2024 04:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants