Ui bugfixes #137
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
KittenSquad/glewlwyd!137
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "ui-bugfixes"
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?
Hello @babelouest,
Your UI refactoring looks excellent. Thank you!
Meanwhile here is a supplementary PR (on top of your
yrammos-ui-tidbitsbranch) for two bugs that are apparently inherited frommasterbut become more apparent after these UI changes.20f5db0eThis is a fix for two independent navbar bugs:
Profile app bug
There is a line in
Profile/App.jsthat I'm not sure about and have marked accordingly in the comments.Admin app bug
287c4ec1This is a fix to an insidious "Continue" button bug:
This bug fix ensures that this spurious "Change User" operation is no longer necessary.
@ -104,6 +104,8 @@ class App extends Component {this.setState({loggedIn: message.message}, () => {better off using one
this.setStaterather than 2console.logare not necessaryAs I said in this comment:
github.com/yrammos/glewlwyd@6dccebdb81 (r39940743), you should not callapiManager.glewlwydRequestinside therender()function. What are you trying to achieve here?@ -64,7 +64,8 @@ class App extends Component {} else if (message.type === 'loggedIn') {Those 3
setStatecalls should be merged in one, especially since a setState is asynchronous, this could lead to undefined behavior...@babelouest there was a confusion of commits. I'll review your comments and revise as necessary. Thank you.
@babelouest thank you for the review.
The reproduction vector is described in the PR. To describe the symptom (not the cause) in brief: the green "Continue" button does not actually continue if the current user was made active automatically after another user logged out.
Updated. If you agree on the principle, I'll move the API call outside of
render()(shameful mistake).@yrammos , instead of calling the API inside the render, you should probably look around the navbar event when the user clicks logout, after that the event should be propagated to App.js. There, a call to
this.fetchProfile();should be sufficient to update the buttons.Also, please use the
Resolve conversationbutton when you commit changes that fixes the reviews, it'll be easier to follow.@babelouest
this.fetchProfile()is a method ofProfile/App.js, whereas the bug is manifest just also when logging in from the Admin app (which doesn't have afetchProfilein the first place). I think that the Login app is the real "owner" of the bug: once again, clicking on "Change User => [Username]" to select the already active user resolves the problem. (Of course the user shouldn't have to do this.) Doesn't this symptom the locate the problem, conceptually, in the Login page? I'll try moving the fix fromrender()to the constructor ofLogin/App.js.@ -64,7 +64,8 @@ class App extends Component {} else if (message.type === 'loggedIn') {@babelouest I am unsure about the last of these three
setStatestatements (which I will merge into one): is there supposed to be a 1-1 correspondence betweenprofileListandschemeListmembers? In other words, whenprofileList[0]logs out and is popped fromprofileList, shouldschemeList[0]also be popped fromschemeList?My bad, I mixed up admin and profile page, but the pages architecture are similar with an App.js and bottom up message transmission. Let me know if you need help understanding the code
@ -64,7 +64,8 @@ class App extends Component {} else if (message.type === 'loggedIn') {If you log out from a component, you should send a message to App component so it will refresh The status of all subcomponents.
@ -64,7 +64,8 @@ class App extends Component {} else if (message.type === 'loggedIn') {Right, I understand that @babelouest, in fact I’m working precisely on the message receiver here. I believe that the original code incorrectly zeroes out the entire
profileListwhereas only the last active user should be removed (profileList[0]). I’ve checked this part of the fix quite a bit and it looks robust. My question is whether the same fix should be repeated forschemeListas well.@ -64,7 +64,8 @@ class App extends Component {} else if (message.type === 'loggedIn') {I think I figured it out:
schemeListis the current user's list of authentication schemes, so it should be indeed zeroed out each time a user logs out. Declaring this resolved and I assume it will raise a red flag with you if my understanding is incorrect.@babelouest the API call is now moved outside
render().My informal testing suggests that the PR fixes the two bugs mentioned above but creates an issue with the red Log Out button of
Login/Buttons.js, which does logs out but then immediately logs back in.I confess having difficulties navigating the code because all your components are stateful. In my modest experience with ReactJS only a minimal number of components are stateful and the rest rely on immutable props. Would be thankful if you could take a look at the red button issue.
@yrammos , I agree my react code isn't very clean in terms of statefulness, I'm no expert either.
But I'm trying to understand where you at with your pull requests. You closed #136 without having it merged in my master, is it for a reason?
Sincere apologies, @babelouest—closed by accident. (Working under tight deadline, fingers running ahead of mind.)
@yrammos , don't worry, but especially since you have a deadline, let's focus on one step at a time, when we'll complete this PR, we'll take care of the next one
Grateful for your help @babelouest. Just to note the deadline is mine—I don’t mean to impose !
@babelouest this PR has a slew of problems and, you're right, better wait until past PR have been merged. Closing for now; I'll resubmit as an issue after #136 has been merged.
@yrammos , btw, I've found a bug in the backend related to the logout button, I fixed it in my branch. Also, I've figured how to fix the UI bug too, it'll be easy as well, it only requires to reload the user list when the logout button is clicked. With the backend fix it'll work.
Pull request closed