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

Check server version against app minimum api version #737

Merged
merged 4 commits into from
Jun 21, 2023

Conversation

beatgammit
Copy link
Contributor

This will pop up the version error dialog every time the user launches the app.

Fixes #701 and #673.

@beatgammit
Copy link
Contributor Author

This also implements logging in with older, "unsupported" servers. I didn't fully test everything, but the basics seem to work (logging in, making posts, responding to posts, etc).

@beatgammit beatgammit marked this pull request as draft June 19, 2023 13:26
@beatgammit beatgammit force-pushed the feat/api-version-check branch from c772f00 to 21e2d2a Compare June 21, 2023 04:48
@beatgammit beatgammit changed the base branch from autogen_types_merge_1 to main June 21, 2023 04:50
This will pop up the version error dialog every time the user launches
the app.
@beatgammit beatgammit force-pushed the feat/api-version-check branch from 5bc5177 to 67e7eec Compare June 21, 2023 05:11
@beatgammit beatgammit marked this pull request as ready for review June 21, 2023 05:11
@beatgammit beatgammit force-pushed the feat/api-version-check branch from 67e7eec to 906368d Compare June 21, 2023 05:12
Copy link
Member

@dessalines dessalines left a comment

Choose a reason for hiding this comment

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

I tested, and it works great, thanks a ton for this. Just needs a translation string.

)
val siteVersion = siteRes.data.version
if (compareVersions(siteVersion, MINIMUM_API_VERSION) < 0) {
Toast.makeText(ctx, "Server version too low.", Toast.LENGTH_SHORT).show()
Copy link
Member

Choose a reason for hiding this comment

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

Needs a translation

Copy link
Contributor Author

@beatgammit beatgammit Jun 21, 2023

Choose a reason for hiding this comment

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

Not sure how to do that since stringResource needs a Composable block. That's why I didn't use the AlertDialog here.

I can look into it again though, there ought to be a solution. I'll look around though.

Copy link
Member

Choose a reason for hiding this comment

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

I think ctx.getString(R.string... is how you do it.

https://stackoverflow.com/a/7454485

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks. It's fixed now.

@beatgammit beatgammit force-pushed the feat/api-version-check branch from 6845d09 to 8e0c496 Compare June 21, 2023 22:34
Copy link
Member

@dessalines dessalines left a comment

Choose a reason for hiding this comment

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

LGTM, thanks. We're now all set for 0.18.0 !

I'll do a jerboa release the same day as we do the lemmy release, so it should be on izzyondroid that day, and github releases immediately.

@dessalines dessalines enabled auto-merge (squash) June 21, 2023 22:36
@dessalines dessalines merged commit fb80235 into LemmyNet:main Jun 21, 2023
@MV-GH
Copy link
Collaborator

MV-GH commented Jun 22, 2023

@dessalines Is it possible to do a earlier release but not make available. So that it gets already reviewed. Atm it takes about a week to be actually available on the play store. And in that period users wont be able to use the app.

@beatgammit
Copy link
Contributor Author

I propose turning on "Managed Publishing" as mentioned here: https://support.google.com/googleplay/android-developer/answer/9859654?hl=en

So submit ASAP but hold the publish for the day 0.18 goes live.

Then turn it off afterward until the next big lemmy release.

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.

Do a version check on login, to say whether the current version of jerboa supports your server.
3 participants