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

Edits to Getting Started and Basic Info docs #177

Merged
merged 26 commits into from
May 3, 2019

Conversation

shaydewael
Copy link
Contributor

Summary

Went through and make edits based on @aoberoi suggestions. Also made a pass through the Getting Started guide.

Requirements (place an x in each [ ])

@aoberoi
Copy link
Contributor

aoberoi commented May 3, 2019

can you link to the original PR with the comments? i have no idea where those are now lol.

@shaydewael
Copy link
Contributor Author

#155

@@ -5,36 +5,41 @@ order: 2
---

<div class="section-content">
Copy link
Contributor

Choose a reason for hiding this comment

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

this section is so so good!


const authorizeFn = async (source, body) => {
const authorizeFn = async ({ teamId, enterpriseId }) => {
// Fetch team info from database. You could also set userToken instead.
const fetchAuthorizedTeam = new Promise((resolve, reject) => {
teamInfo[source.enterpriseId][source.teamId] !== undefined ?
Copy link
Contributor

Choose a reason for hiding this comment

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

this no longer works. needs to be changed to iterate over the installations array and find any authorization that makes both the given teamId and enterpriseId. that's my bad. this is where i stopped my previous review and never was able to finish.

docs/_basic/acknowledging_requests.md Outdated Show resolved Hide resolved
docs/_basic/listening_responding_commands.md Outdated Show resolved Hide resolved
docs/_basic/listening_responding_commands.md Outdated Show resolved Hide resolved
docs/_tutorials/getting_started.md Outdated Show resolved Hide resolved
docs/_tutorials/getting_started.md Outdated Show resolved Hide resolved
docs/_tutorials/getting_started.md Outdated Show resolved Hide resolved
docs/_tutorials/getting_started.md Outdated Show resolved Hide resolved
docs/_tutorials/getting_started.md Outdated Show resolved Hide resolved
@codecov-io
Copy link

codecov-io commented May 3, 2019

Codecov Report

Merging #177 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #177   +/-   ##
=======================================
  Coverage   48.86%   48.86%           
=======================================
  Files           7        7           
  Lines         440      440           
  Branches      120      120           
=======================================
  Hits          215      215           
  Misses        213      213           
  Partials       12       12

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b58bbe2...b666c86. Read the comment docs.

@shaydewael shaydewael requested a review from aoberoi May 3, 2019 21:21
// Check for matching teamId and enterpriseId in the installations array
if ((team.teamId === teamId) && (team.enterpriseId === enterpriseId)) {
// This is a match. Use these installaton credentials.
Promise.resolve(team);
Copy link
Contributor

Choose a reason for hiding this comment

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

sorry, this is a nitpick. can we do something like return { botToken: team.botToken, botId: team.botId, botUserId: team.botUserId }; instead? first, wrapping in Promise.resolve() is unnecessary since we are in an async function. second, i think it might be important to "show our work" and that the naming of the properties is explicit and important (not just rely on the coincidence that the persistence model happens to also use a compatible shape).

}
}

Promise.reject();
Copy link
Contributor

Choose a reason for hiding this comment

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

throw an error instead of using Promise.reject().

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