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

Fix merge conflict and some additional typos #43

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

DaniyelMe
Copy link
Contributor

@samuelgozi I've fixed the merge conflicts and I added some additional typo fixes.

Copy link
Owner

@samuelgozi samuelgozi left a comment

Choose a reason for hiding this comment

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

There are many small changes that are not really useful to fix. For example regular comments, and comments in tests. The problem with them is that it’s time consuming to check them, and the grammar fix doesn’t really alp at all.
I’ll approve the, this time, but please avoid investing time in such small changes.
All other changes are good, and welcome.

I’ll wait for any additional feedback from the community as English is not my first language, and please fix the requested changes.

Thank you!

README.md Outdated
1. It is more secure. The reason you need to whitelist in the first place is for security.
2. It is way faster, in some cases up to 5 seconds faster.
3. I don't trust firebase (or anyone) with my user's private data, and you shouldn't either.
1. More secure, it's the reason you need to whitelist in the first place is for security.
Copy link
Owner

Choose a reason for hiding this comment

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

This fix is not good. The sentence doesn’t make sense. It should be:
It’s more secure. That’s the reason you need to whitelist in the first place is for security.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

resolved in #86991a5

README.md Outdated
2. It is way faster, in some cases up to 5 seconds faster.
3. I don't trust firebase (or anyone) with my user's private data, and you shouldn't either.
1. More secure, it's the reason you need to whitelist in the first place is for security.
2. Way faster, in some cases up to 5 seconds faster.
Copy link
Owner

Choose a reason for hiding this comment

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

Here too. Omitting “It’s” doesn’t make sense.

src/main.js Outdated
@@ -66,14 +66,15 @@ export default class Auth {
// we need to check if this environment supports `addEventListener` on the window.
'addEventListener' in window &&
window.addEventListener('storage', e => {
// This code will run if localStorage for this user
// data was updated from a different browser window.
// This code will run if the local storage for this user
Copy link
Owner

Choose a reason for hiding this comment

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

The meaning was literally “localStorage” as in the API, so this one needs to remain as it was.

src/main.js Outdated
@@ -104,7 +105,7 @@ export default class Auth {
}

/**
* Makes a post request to a specific endpoint and returns the response.
* Makes post request to a specific endpoint and return the response.
Copy link
Owner

Choose a reason for hiding this comment

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

Here too it should be as it was.
If you are checking this with grammarly or something similar it will think that “post” is a verb, but it isn’t, so it doesn’t make sense to remove “a”. And it should also remain “returns”.

src/main.js Outdated
@@ -122,7 +123,7 @@ export default class Auth {
let data = await response.json();

// If the response returned an error, try to get a Firebase error code/message.
// Sometimes the error codes are joined with an explanation, we don't need that(its a bug).
// Sometimes the error codes are joined with an explanation, we don't need that.
Copy link
Owner

Choose a reason for hiding this comment

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

The comment that’s it’s a bug is important so that future contributors know why the code does what it does. If it gets fixed in the future it will affect the way we want to handle it

src/main.js Outdated
@@ -260,7 +261,7 @@ export default class Auth {
// Is required to finish the auth flow, I believe this is used to mitigate CSRF attacks.
// (No docs on this...)
await this.storage.set(this.sKey('SessionId'), sessionId);
// Save if this is a fresh log-in or a "link account" request.
// Save if this is a fresh signed in or a "link account" request.
Copy link
Owner

Choose a reason for hiding this comment

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

Should be “sign in” not “signed in”

// before completing the linkAccount request.
if (linkAccount && !this.user) throw Error('Request to "Link account" was made, but user is no longer signed-in');
if (linkAccount && !this.user) throw Error('Request to "Link account" was made, but user is no longer signed in');
Copy link
Owner

Choose a reason for hiding this comment

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

Changing error messages should be done separately or with a notice as some users might depend on the exact string.
Since this is a beta I’ll approve it but it’s can usually be considered a breaking change.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is important to know, I didn't know. Thanks.

@@ -361,8 +361,8 @@ export default class Auth {

/**
* Sends an out-of-band confirmation code for an account.
* It can be used to reset a password, to verify an email address and send a sign-in email link.
Copy link
Owner

Choose a reason for hiding this comment

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

Sign-in is used as a noun here, so the hyphen should remain.

src/main.js Show resolved Hide resolved
src/main.js Outdated
* @param {Object} newData An object with the new data.
* @throws Will throw if the user is not signed-in.
* @throws Will throw if the user is not signed in.
* Update user's profile.
Copy link
Owner

Choose a reason for hiding this comment

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

Again. The description should be on top. Please revert

@DaniyelMe
Copy link
Contributor Author

Thank you for your patient, I've fixed the requested changes.
It's wise to take the time and evaluate the changes by others, that's way I'm always asking @awinograd feedback.

Anyway, feel free to cherry pick changes, if at all.
Stay safe.

Copy link
Contributor

@awinograd awinograd left a comment

Choose a reason for hiding this comment

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

Most of the changes are stylistic / personal preference. There are a handful of grammar fixes. Nothing harmful in my opinion

if (e.key !== this.sKey('User')) return;
this.setState(JSON.parse(e.newValue), false);
});
}

/**
* Emits an event and triggers all the listeners.
Copy link
Contributor

Choose a reason for hiding this comment

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

duplicate line

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed the other one (line78), thanks.

src/main.js Outdated
return this.refreshIdToken(); // Won't do anything if the token is valid.
}

/**
* Updates the user data in localStorage.
* @param {Object} userData New user data.
* @param {boolean} [updateStorage = true] Check whether to update localStorage or not.
* @param {boolean} [persist = true] Whether to update local storage or not.
Copy link
Contributor

Choose a reason for hiding this comment

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

should be localStorage for consistency with the rest of comments

Copy link
Contributor Author

Choose a reason for hiding this comment

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

true, I'll fix it and another one in line 260.

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.

3 participants