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

[Communication] - Documentation - Update docs #730

Merged
merged 5 commits into from
Feb 26, 2021

Conversation

JoshuaLai
Copy link
Member

No description provided.

@JoshuaLai JoshuaLai requested review from sacheu and a team as code owners February 23, 2021 19:59
@ghost ghost added the Communication label Feb 23, 2021
*/
internal class AutoRefreshTokenCredential: CommunicationTokenCredentialProviding {
private let accessTokenCache: ThreadSafeRefreshableAccessTokenCache

/**
Creates a `CommunicationTokenCredential` that automatically refreshes the token using the provided `tokenRefresher`.
Creates a `CommunicationTokenCredential` that automatically refreshes
the token using the provided `tokenRefresher`.
Copy link
Member

Choose a reason for hiding this comment

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

Why we break this into 2 lines?

@@ -60,10 +62,12 @@ internal class AutoRefreshTokenCredential: CommunicationTokenCredentialProviding
}

/**
Retrieve an access token from the cache, or from the `tokenRefresher` if the token is not in the cache or is expired.
Retrieve an access token from the cache, or from the `tokenRefresher`
if the token is not in the cache or is expired.
Copy link
Member

Choose a reason for hiding this comment

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

same line?


/**
Creates a new instance of CommunicationAccessToken using the provided `token`
and `expiresOn`.
Copy link
Member

Choose a reason for hiding this comment

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

Same line as above?

@@ -27,7 +27,9 @@
import Foundation

/**
Common Communication Identifier protocol for all Azure Communication Services. All Communication Identifiers conform to this protocol.
Common Communication Identifier protocol for all
Azure Communication Services.
Copy link
Member

Choose a reason for hiding this comment

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

Same line?

Copy link
Member

Choose a reason for hiding this comment

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

and seems like '. All Communication Identifiers conform to this protocol.' is removed.

- Parameter userId: Id of the Microsoft Teams user. If the user isn't anonymous, the id is the AAD object id of the user.
- Parameter isAnonymous: Set this to true if the user is anonymous, for example when joining a meeting with a share link.
- Parameter userId: Id of the Microsoft Teams user. If the user isn't anonymous,
the id is the AAD object id of the user.
Copy link
Member

Choose a reason for hiding this comment

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

Putting this in separate lines make them harder to read

- Parameter userId: Id of the Microsoft Teams user. If the user isn't anonymous,
the id is the AAD object id of the user.
- Parameter isAnonymous: Set this to true if the user is anonymous,
for example when joining a meeting with a share link.
Copy link
Member

Choose a reason for hiding this comment

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

Putting this in separate lines make them harder to read

@sacheu
Copy link
Member

sacheu commented Feb 24, 2021

In general, in some places, breakin the text into 2 lines make the comment harder to read.

@JoshuaLai
Copy link
Member Author

In general, in some places, breakin the text into 2 lines make the comment harder to read.

Yes I did that on purpose to fix warnings. There was a bunch of warnings the linter was complaining about.

@sacheu
Copy link
Member

sacheu commented Feb 25, 2021

In general, in some places, breakin the text into 2 lines make the comment harder to read.

Yes I did that on purpose to fix warnings. There was a bunch of warnings the linter was complaining about.

I guess I don't understand why linter was complaining about. Since the line was not that long originally.

@JoshuaLai
Copy link
Member Author

Just double checking, but yes the liner was complaining that the character limit is 120 and in some cases we were just a little bit over (124 characters) or very over (240 characters) so the goal was to just clean these up

@sacheu
Copy link
Member

sacheu commented Feb 25, 2021

Is it possible to change the text to shorter so that they can be in same line? e.g.
"and" -> "&"
"Set this to true " -> "Set to true"
"for example" -> "e.g."


- Parameter completionHandler: Closure that accepts an optional `AccessToken` or optional `Error` as parameters.
`AccessToken` returns a token and an expiry date if applicable. `Error` returns `nil` if the current token can be returned.
`AccessToken` returns a token and an expiry date if applicable.
Copy link
Member

Choose a reason for hiding this comment

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

there is an extra space between 'returns' and 'a'

@sacheu
Copy link
Member

sacheu commented Feb 25, 2021

And in the Chat generated code, there is // swiftlint:disable line_length
I wonder if we should do this instead of breaking 1 sentence comment into 2 lines

https://github.com/Azure/azure-sdk-for-ios/blob/41039cc13f33b515d2fe353b478707df6840f140/sdk/communication/AzureCommunicationChat/Source/Generated/Models/UpdateChatMessageRequest.swift

@sacheu
Copy link
Member

sacheu commented Feb 25, 2021

And in the Chat generated code, there is // swiftlint:disable line_length
I wonder if we should do this instead of breaking 1 sentence into 2 lines

https://github.com/Azure/azure-sdk-for-ios/blob/41039cc13f33b515d2fe353b478707df6840f140/sdk/communication/AzureCommunicationChat/Source/Generated/Models/UpdateChatMessageRequest.swift

@@ -1,2 +1,5 @@
disabled_rules: # rule identifiers to exclude from running
- large_tuple

Copy link
Member Author

Choose a reason for hiding this comment

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

@tjprescott @sacheu making a new addition to swiftlint line length rule to ignore comments.

Copy link
Member

@sacheu sacheu left a comment

Choose a reason for hiding this comment

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

Looks good to me. I think some changes can be reverted now.

@JoshuaLai JoshuaLai merged commit d87f934 into Azure:master Feb 26, 2021
@JoshuaLai JoshuaLai deleted the communication/documentation branch February 26, 2021 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants