-
Notifications
You must be signed in to change notification settings - Fork 0
Conversation
@@ -10,6 +10,7 @@ import com.google.firebase.ktx.Firebase | |||
|
|||
object Database { | |||
fun get(): FirebaseDatabase { | |||
return Firebase.database("https://vibester-sdp-default-rtdb.europe-west1.firebasedatabase.app") | |||
val db = Firebase.database("https://vibester-sdp-default-rtdb.europe-west1.firebasedatabase.app") | |||
return db |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need the extra variable declaration here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no that was temporary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM already just one small comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your changes! There are several issues I ave addressed in the comments, can you respond to them? Thanks!
General comment, we should redirect user to the profile account after the user created the account. Right now, the user created account, automatically logged in, and then it is not redirected to profile account. You press go back, and the login is not displayed in the bottom of welcome page. It is resetted apparently.
@@ -76,11 +76,15 @@ class UsersRepo @Inject constructor() { | |||
for (dataSnapShot in dataSnapshot.children) { | |||
val dbContents = dataSnapShot.getValue<UserProfile>() | |||
if (dbContents != null) { | |||
Log.e("pp urepo ",dbContents.image ) | |||
Log.e("memail 1 ",dbContents.email ) | |||
Log.e("memail 2 ",email ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in general, is it okay that log is there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am asking cause they dont respond to the error, so they are for personal testing. From the 'best' practices, should they be in the main branch of the code? If yes, then lets do more comprehensive text?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no that was debug stuff and will be removed
callback(dbContents) | ||
break | ||
} else { | ||
callback(UserProfile()) | ||
//callback(UserProfile()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we remove this callback?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes this callback is wrong, cause it goes across around all player in db, and validate the login even if not the good one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will even remove the comments and clear the line
/* | ||
val getIntent = intent.extras | ||
if (getIntent!=null){ | ||
testLoggedIn = getIntent.getBoolean("testLoggedIn", false) | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if not used, remove completely?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes (sorry old test stuff)
|
||
|
||
val userStatusTextValue = findViewById<TextView>(R.id.user_status) | ||
if(FireBaseAuthenticator.isLoggedIn() || testLoggedIn) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we are pushing to the main branch, I believe the code should be as clean as possible. So I am not sure whether the testing variables hsould be in main
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is testing var for cirrus, this is necessary (trick to allow unit test to test the below code, otherwise impossible)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ohhh, i seee
if (bm != null) { | ||
Log.e(getString(R.string.log_tag), bm.height.toString() + " - " + bm.width.toString()) | ||
}else{ | ||
Log.e(getString(R.string.log_tag), "ahhhh merde") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
noooo no merde
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hahahaha forget to remove it 😅 😅 Do we see I get frustrated with that code 😂 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah merde
bit.get() | ||
Log.e(getString(R.string.log_tag),user.image) | ||
val bit = BitmapGetterApi.download("https://raw.githubusercontent.com/Ashwinvalento/cartoon-avatar/master/lib/images/male/45.png") | ||
bit.get(10, TimeUnit.SECONDS) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the user image will be displayed during 10 seconds? isnt it a lot?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No the 10 sec is the timeout to get the image. Indeed it is a magic number for the moment, but I may set it a global var for all async timeout and should choose the value later
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got you!
val bit = BitmapGetterApi.download("https://" + user.image) | ||
bit.get() | ||
Log.e(getString(R.string.log_tag),user.image) | ||
val bit = BitmapGetterApi.download("https://raw.githubusercontent.com/Ashwinvalento/cartoon-avatar/master/lib/images/male/45.png") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
something to think about...
There are three options about profile images:
- We save the default image link in every profile in firebase.
- We save an image in our app
- We upload the picture from github every time (as you do)
We use profile picture in scoreboard, user search and in a profile account. If we take scoreboard, there might be a lot of profiles without the image, maybe it would be better if each of the profile has a default image, so we dont do extra check and upload image your way. Or it would be better to have an image locally, since it is same and we dont upload your way every time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes we will see and try to solve this issue. Currently this is just a random image to test the display. I will rework it in part 2. There was issue with the database and account code that I will solve in part 2.
Yes It will be done in the part 2 the following week, it is part of the rework |
Code Climate has analyzed commit d45b7df and detected 1 issue on this pull request. Here's the issue category breakdown:
The test coverage on the diff in this pull request is 84.2% (80% is the threshold). This pull request will bring the total coverage in the repository to 87.9% (-0.8% change). View more on Code Climate. |
Thank you for replying to my comments! Approved! |
Rework Authentication (part 1)
This is related to issue #161
This Pull Requests contains:
In addition the code is tested with a coverage of: [??]%
Notes for reviewers
=> I have read many docs concerning firebase, I've already spent more than 10h doing all my stuff.
Here is the first pr for the first part, the 2nd one will come later in the week.