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

Simplify and explain login flow #2317

Merged
merged 7 commits into from
Sep 15, 2024
Merged

Simplify and explain login flow #2317

merged 7 commits into from
Sep 15, 2024

Conversation

corrideat
Copy link
Member

No description provided.

@corrideat corrideat requested a review from taoeffect August 24, 2024 15:59
Copy link

cypress bot commented Sep 8, 2024

group-income    Run #3100

Run Properties:  status check passed Passed #3100  •  git commit 0cdc4d2044 ℹ️: Merge 20f94273df2b9e72cdc2d8ac544ad4f0d57a3596 into e341e652a02766143f1a084f3547...
Project group-income
Branch Review 2271-simplify-login-flow
Run status status check passed Passed #3100
Run duration 09m 36s
Commit git commit 0cdc4d2044 ℹ️: Merge 20f94273df2b9e72cdc2d8ac544ad4f0d57a3596 into e341e652a02766143f1a084f3547...
Committer Ricardo Iván Vieitez Parra
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 10
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 111
View all changes introduced in this branch ↗︎

Copy link
Member

@taoeffect taoeffect left a comment

Choose a reason for hiding this comment

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

Question: is this PR finished or is there more work to do?

I ask because as far as the jumping around between events related to login that happens when following the logic of actions/identity.js and app/identity.js, that seems unchained. Is there no way to simplify that part / make it clearer?

@corrideat
Copy link
Member Author

Question: is this PR finished or is there more work to do?

As mentioned on Slack, the only thing missing (other than feedback) is completing the LOGIN_FLOW.md file.

I ask because as far as the jumping around between events related to login that happens when following the logic of actions/identity.js and app/identity.js, that seems unchained. Is there no way to simplify that part / make it clearer?

I'm going to assume you mean unchanged other than unchained. Even then, I'm still unsure what you're asking specifically.

If you're talking about where the event listeners are defined, they are in those files as per your request when those event listeners were defined. There's no particular reason why they couldn't be in a different location.

If you're talking about the events themselves, that's the result of the service worker and the app being different contexts entirely and of both needing to know about the currently logged in user.

@taoeffect
Copy link
Member

I'm going to assume you mean unchanged other than unchained.

Yes, that was a typo.

This PR does a great job of simplifying main.js. As-is, it's an improvement over what we have.

What I'm wondering is, is it possible in any way at all, to simplify the logic that's inside of gi.app/identity/login and gi.actions/identity/login (and related code)? Is this something you can take a closer look at? If nothing can be done to simplify it, then I suppose we'll have to live with it as-is, but if something can be done to simplify it, it would be awesome and also this would probably be the time to do it.

@corrideat
Copy link
Member Author

gi.app/identity/login and gi.actions/identity/login

I've taken a look and it looks pretty simple to me already (both about 100 lines with relatively straightforward logic). I'll add some brief additional comments to the uncommented sections.

@corrideat
Copy link
Member Author

I consider this PR complete now unless there are additional requests. I highly recommend taking the time to read through LOGIN_FLOW.md. It's an extensive file that presents in detail the motivations behind everything, documents where things happen and why and walks though specific scenarios.

LOGIN_FLOW.md Outdated Show resolved Hide resolved
LOGIN_FLOW.md Outdated Show resolved Hide resolved
LOGIN_FLOW.md Outdated Show resolved Hide resolved
LOGIN_FLOW.md Outdated Show resolved Hide resolved
LOGIN_FLOW.md Outdated Show resolved Hide resolved
Copy link
Member

@taoeffect taoeffect left a comment

Choose a reason for hiding this comment

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

Excellent work on LOGIN_FLOW.md! Left some requests for changes & typo fixes.

@corrideat
Copy link
Member Author

Thanks! Updated as requested.

Copy link
Member

@taoeffect taoeffect left a comment

Choose a reason for hiding this comment

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

Alright @corrideat - this PR is quite something. I tested it, and it seems to work. The tests pass. Let's cross our fingers nothing sneaky broke. 🤞

@taoeffect taoeffect merged commit a012482 into master Sep 15, 2024
4 checks passed
@taoeffect taoeffect deleted the 2271-simplify-login-flow branch September 15, 2024 18:56
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.

2 participants