Prevent crash when logging in #81
No reviewers
Labels
No Label
Difficulty - Beginner friendly
Difficulty = Easy
Difficulty = Hard
Difficulty = Medium
Priority = CRITICAL
Priority = High
Priority = Low
Priority = Normal
Priority = Some day
Status - Fixed somewhere else
Status - No details provided
Status = Can't fix
Status = Duplicate
Status = Help wanted
Status = Invalid
Status = Need more details
Status = Taken
Status = Wontfix
Type - Selfoss works like this
Type = Bug
Type = Chore
Type = Enhancement
Type = Feature
Type = Question
Type = SELFOSS API ISSUE
Type = Tools
Type = UX/Design
Up For Grabs
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: Louvorg/ReaderForSelfoss-multiplatform#81
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "davidoskky/ReaderForSelfoss-multiplatform:login_crash"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Types of changes
While running on some emulators I have seen that it sometimes crashes on login because it tries to make api calls on localhost.
Preventing those calls if not already logged in solves the problem.
I also moved the definition of dateUtils within the login function so that it gets updated after logging in.
@ -47,3 +46,1 @@
updateApiVersion()
dateUtils = DateUtils(appSettingsService)
reloadBadges()
if (appSettingsService.getBaseUrl() != "") {
getBaseUrl
should never return an empty string.There is a verification done before even logging-in (and saving the settings), so this should never happen.
The repository is initialized before logging in, at that point appSettingsService returns an empty string
Ok, so this is a workaround.
The issue is that the
runBlocking
block is called even when the user is'nt updated. This should be fixed.I could remove this from the init method and make a new public method which is called by the login activity after it checks that the user is correctly set.
that could be better, yes !
@ -408,6 +409,7 @@ class Repository(private val api: SelfossApi, private val appSettingsService: Ap
appSettingsService.updateApiVersion(fetchedVersion.data.getApiMajorVersion())
}
}
dateUtils = DateUtils(appSettingsService)
why was this added ?
If the repository is initialized before the login, this is required to initialize the dateUtils after logging in