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

Failing to retrieve nodeinfo causes a crash #1569

Open
MV-GH opened this issue Jun 25, 2024 · 3 comments
Open

Failing to retrieve nodeinfo causes a crash #1569

MV-GH opened this issue Jun 25, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@MV-GH
Copy link
Collaborator

MV-GH commented Jun 25, 2024

Jerboa Version

0.0.69

Android Version + Phone

N/A

Describe The Bug

This is a oversight in my implementation. I indirectly used the version that did this in on purpose.

    suspend fun getLemmyVersion(instance: String): String {
        val node = getNodeInfo(instance).getOrThrow()
        return getLemmyVersion(node)
    }

Now this is exacerbated because it doesn't retry like the other endpoints do. (The other have failsafe retry of 5 times exponentially,) This will be fixed.

This is very problematic because if an instance goes offline for the current account that would cause the app to crash? Or going offline should make the app crash? How come I have not seen any complaints from users?

Getting the version is requirement that can't be bypassed, I need this version to correctly select the right implementation. That can differ between patches. So guessing the latest version is not viable solution. As of right now not even 10% are on 0.19.5. And 0.19.4. , 0.19.0 and 0.19.2 all have different implementations which would cause core functionality to fail. If selected wrongly.

So the only right solution is keep this failure? Catch it show retry snackbar? Maybe hook it into the existing verification system?

The crash

image

To Reproduce

Ig, turn internet off? open app?

In the case of a crash or when relevant include the logs

No response

@MV-GH MV-GH added the bug Something isn't working label Jun 25, 2024
@dessalines
Copy link
Member

This is very problematic because if an instance goes offline for the current account that would cause the app to crash? Or going offline should make the app crash? How come I have not seen any complaints from users?

If its lemmy.ml, there's not much we can do, since that's the default / "backup" instance.

suspend fun getLemmyVersion(instance: String): String

I'd have to check, but it might be more clear to make this optional, and if its null, then load the default / anonymous mode. You might already be catching this thrown error and doing this already.

@MV-GH
Copy link
Collaborator Author

MV-GH commented Jul 2, 2024

I am thinking of only returning Result for functions that can throw, so that means getLemmyInstance would also become a result and then I would be forced to deal with during compile.

In Jerboa I will look into catching this exception, then trigger the flow I have setup already. I will probably have to integrate this into verification thingy so that it would propagate the snackbar into every screen easily. But won't be so clean as it will also have to do it for anon. Which it originally wasn't designed to do.

If its lemmy.ml, there's not much we can do, since that's the default / "backup" instance.

Show snackbar warning with retry + allow users to switch/login

@dessalines
Copy link
Member

I am thinking of only returning Result for functions that can throw, so that means getLemmyInstance would also become a result and then I would be forced to deal with during compile.

Absolutely, please do, using Results and dealing with these errors or missing values at compile time is one of the main reasons everyone (including me) loves rust so much. I'd def prefer that, or even options in kotlin, over throwing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants