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

New user workflow problem: Trying to send a message from gotify android before any apps are defined on server causes hang and crash of android app #178

Open
parktheredcar opened this issue Jun 7, 2021 · 1 comment
Labels
a:bug Something isn't working good first issue Good for newcomers

Comments

@parktheredcar
Copy link

Trying to push a message out from the android app before any applications are defined on the gotify server causes the android app to hang until android ui offers to kill it.

Once an application has been defined on the server, the app dropdown on android's push message screen can no longer be set to a null selection, and it is no longer possible to trigger this issue through the app's ui.

As a side effect, if the user accepts android's "kill hanging app" prompt, this also can put the gotify app to get in a state where the background listener is dead despite the main gotify app running in the foreground. This can lead to the app seeming unable to receive push notifications for a new user,

@parktheredcar parktheredcar changed the title New user workflow - trying to send message from android before any apps are define on server crashes app New user workflow problem: Trying to send a message from gotify android before any apps are defined on server causes hang and crash of android app Jun 7, 2021
@jmattheis jmattheis added the a:bug Something isn't working label Jun 7, 2021
@jmattheis
Copy link
Member

Good catch. The service currently tries to obtain the application image from the application. If there is a new application and the cache isn't refreshed, then there should be some kind of default instead of an error.

public Bitmap getIcon(Long appId) {
if (appId == -1) {
return BitmapFactory.decodeResource(context.getResources(), R.drawable.gotify);
}
try {
return picasso.load(
Utils.resolveAbsoluteUrl(
settings.url() + "/", appIdToAppImage.get(appId)))
.get();
} catch (IOException e) {
Log.e("Could not load image for notification", e);
}
return BitmapFactory.decodeResource(context.getResources(), R.drawable.gotify);
}

@jmattheis jmattheis added the good first issue Good for newcomers label Jun 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:bug Something isn't working good first issue Good for newcomers
Development

No branches or pull requests

2 participants