Can not add sources if url does not end with a slash #184
Closed
opened 2025-02-28 18:45:38 +00:00 by davidoskky
·
8 comments
No Branch/Tag Specified
master
fix-bottom-bar
release
br
fix-toast
cleaning
v125051211
v125040991
v125030901
v125030711
v125030681
v125020581
v125020471
v125020411
v125010291
v125010241
v125010201
v125010131
v125010111
v125010031
v124123651
v124123641
v124123421
v124113311
v124113301
v124113252
v124113251
v124041081
v124030731
v124020451
v124010301
v124010191
v124010032
v124010031
v123113311
v123102961
v123102852
v123102851
v123102841
v123061811
v123061651
v123051471
v123051331
v123051321
v123051301
v123051211
v123041021
v123030851
v123030751
v123030681
v123030621
v123020572
v123020571
v123020523
v123020522
v123020521
v123020511
v123020491
v123010301
v123010281
v123010261
v123010241
v123010041
v122123641
v122123631
v122123621
v122123611
v122123602
v122123601
v122123571
v122123532
v122123531
v122123522
v122123521
v122123483
v122123482
v122123481
v122123461
v122123431
v122123421
v122123391
v122123381
v122123371
v122123351
v122113181
v122113172
v122113171
v122113161
v122113131
v122113101
v122102881
v122092701
v122092691
v122092671
v122092572
v122092561
Labels
Clear labels
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 labels
Status = Need more details
Milestone
No items
No Milestone
Assignees
AmineB (Amine Bouabdallaoui)
Clear assignees
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: Louvorg/ReaderForSelfoss-multiplatform#184
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Description
If you log in entering the url without a final slash, the login correctly works. However, the url is considered invalid when attempting to add sources.
Steps to Reproduce
Expected behavior: You should be able to add sources anyway.
I couldn't reproduce. Are you sure the issue isn't with the selfoss api ?
Strange, I was able to reproduce this on my physical device and on emulated devices with API 25, 34 and 35.
I'm running Selfoss 2.19 stable, but I reckon I do not have a second instance running to test this on. No API call appears to take place, thus I'd exclude it is a problem on server side.
Looking here it appears that urls without a final slash should not even be allowed to log in at all:
However, I am able to log in. When attempting to add a source I receive the error message "Log in to add sources." in a toast. The client has correctly done the login since I am able to use the application normally and my selfoss instance does not allow guest access.
this.toHttpUrlOrNull()returns the url with a slash.Can you provide a screengrab of the error, please?
Here you go, right after tapping the button to add a source I am redirected to the home and the toast appears.
The
isBaseUrlInvalidis called on the login screen, so the result should be the same on the sources screen too.This isn't an issue with the url.
I'll close for now. Please reopen if you have more details.
So, I went through both checks with the debugger.
isBaseUrlInvaliddoes return true in both cases when you use a url without a final slash. However in the login process, that does not stop the login attempt. Login is successful and thus you proceed to the home page. In the source adding page, if the base url is considered invalid then it immediately kicks you out without attempting to perform any operation.It is supposedly a bit strange, because this is the only place in the application where we check the validity of the url after we already did log in. I'm not really sure the check itself is necessary and may be removed altogether from the sources. I think the check is meant to ensure we actually did log in and are not connected as a guest, but that is not really what it is doing.
Alternatively we may stop considering as invalid urls who do not end with a slash, as these appear to be perfectly valid for all other operations.
Thanks for the details. I fixed the issue.