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

[WIP/Don't Merge] Migrated Profile from Rxjava to Retroift & added MVVM Architecture (part 1) #6082

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

neeldoshii
Copy link
Contributor

@neeldoshii neeldoshii commented Dec 26, 2024

Part of:

Description:

The following PR focuses on removing the RxJava usage for Achievement Screen, split the code into a MVVM pattern, cleaned the code and also fixed the flow of the AchievementScreen.

Also, there seems to be an improvement in the loading time of the achievements by some seconds (probably 1-2 seconds) compared to the main branch.

2024-12-26 20:25:54.028 loadTime                fr.free.nrw.commons                  D  The loadtime is 3318ms

@neeldoshii neeldoshii marked this pull request as draft December 26, 2024 15:04
@neeldoshii neeldoshii changed the title Migrated from Rxjava to Retroift, added MVVM Architecture. [Don't Merge] Migrated Profile from Rxjava to Retroift & added MVVM Architecture (part 1) Dec 26, 2024
import timber.log.Timber
import javax.inject.Inject

class ProfileRepository @Inject constructor(private val apiService: APIService) {

This comment was marked as resolved.

) : Response<Int>


// https://tools.wmflabs.org/commons-android-app/tool-commons-android-app//feedback.py?user=Devanonymous
Copy link
Contributor Author

Choose a reason for hiding this comment

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

In this should I provide kdoc here? and if yes kdoc should I link the common apps API endpoint doc or provide a CURL link here?

@neeldoshii neeldoshii changed the title [Don't Merge] Migrated Profile from Rxjava to Retroift & added MVVM Architecture (part 1) [WIP/Don't Merge] Migrated Profile from Rxjava to Retroift & added MVVM Architecture (part 1) Dec 26, 2024
@neeldoshii
Copy link
Contributor Author

Hi @nicolas-raoul,
I have been trying to break Achievement Fragment for a while on main.

compositeDisposable.add(
okHttpJsonApiClient
.getAchievements(userName ?: return)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(
{ response ->
if (response != null) {
setUploadCount(Achievements.from(response))
} else {
Timber.d("Success")
// TODO Create a Method to Hide all the Statistics
// binding.layoutImageReverts.visibility = View.INVISIBLE
// binding.achievementBadgeImage.visibility = View.INVISIBLE
// If the number of edits made by the user are more than 150,000
// in some cases such high number of wiki edit counts cause the
// achievements calculator to fail in some cases, for more details
// refer Issue: #3295
if (numberOfEdits <= 150_000) {
showSnackBarWithRetry(false)
} else {
showSnackBarWithRetry(true)
}
}
},

My Question :

  1. Difference between the editcount received from both the api (https://commons.wikimedia.org/w/api.php?action=query&list=users&usprop=editcount&ususers=Syced&format=json) & ((https://commons-android-app.toolforge.org/tool-commons-android-app/wikidataedits.py?user=Syced)

  2. I have hardcoded my username to your username(Syced) to test achievement with a high upload profile. Despite your edit count having less than 150000 server times out at your username (https://tools.wmflabs.org/commons-android-app/tool-commons-android-app/feedback.py?user=Syced) why is that? what should be the ideal editcount for our server to be able to handle it?

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.

1 participant