Skip to content

Fix a couple things in Typescript client #13863

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

Merged
merged 5 commits into from
Oct 23, 2019
Merged

Fix a couple things in Typescript client #13863

merged 5 commits into from
Oct 23, 2019

Conversation

BrennanConroy
Copy link
Member

@BrennanConroy BrennanConroy commented Sep 10, 2019

Before:
Trace: (WebSockets transport) sending data. .
After:
Trace: (WebSockets transport) sending data. Binary data of length 3.

TODO: Add a test for the "sending data" string.

@BrennanConroy BrennanConroy added the area-signalr Includes: SignalR clients and servers label Sep 10, 2019
@BrennanConroy BrennanConroy added this to the 5.0.0 milestone Sep 10, 2019
@BrennanConroy BrennanConroy modified the milestones: 5.0.0, 5.0.0-preview1 Sep 10, 2019
@jkotalik
Copy link
Contributor

I assume:
Before:
Trace: (WebSockets transport) sending data. .
After:
Trace: (WebSockets transport) sending data. Binary data of length 3. <- period at end.

@@ -608,7 +608,7 @@ export class TransportSendQueue {
offset += item.byteLength;
}

return result;
return result.buffer;
Copy link
Member

Choose a reason for hiding this comment

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

? who uses this?

Copy link
Member Author

@BrennanConroy BrennanConroy Sep 11, 2019

Choose a reason for hiding this comment

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

The getDataDetail method which prints the info I put in the summary

Copy link
Member

Choose a reason for hiding this comment

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

Interesting that the type checker didn't catch this.

Copy link
Contributor

Choose a reason for hiding this comment

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

ArrayBuffer is a weird type. It has basically no public members, you have to wrap it in a view like Uint8Array. It's possible that, because of that, the result object technically does adhere to the ArrayBuffer interface (structurally, since that's all TS actually cares about).

Short answer: Type checker be weird

@BrennanConroy
Copy link
Member Author

Finally got around to adding a test for this

@BrennanConroy
Copy link
Member Author

Ping reviewers, this is ready

@@ -475,7 +475,7 @@ export class HttpConnection implements IConnection {
}

if (this.connectionState === ConnectionState.Connecting) {
this.logger.log(LogLevel.Warning, `Call to HttpConnection.stopConnection(${error}) was ignored because the connection hasn't yet left the in the connecting state.`);
this.logger.log(LogLevel.Warning, `Call to HttpConnection.stopConnection(${error}) was ignored because the connection is still in the connecting state.`);
Copy link
Member

Choose a reason for hiding this comment

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

It would be better throw rather than no-op and log a warning if stopConnection is called while the connection is in the connecting state. HubConnection should await any start tasks in stop() and protect us from this actually occurring.

Copy link
Member Author

Choose a reason for hiding this comment

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

Are you wanting me to change that behavior in this PR?

Copy link
Member

Choose a reason for hiding this comment

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

If it's not too risky, yes. I don't want to have to spin a new PR for some code cleanup. If it causes a bunch of tests to fail, or you feel it's risky, we can make it another PR.

Copy link
Member

@halter73 halter73 left a comment

Choose a reason for hiding this comment

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

I'd like to throw from stopConnection if it's called while connecting instead of log and no-op, but if that's too much for this PR, I understand.

@BrennanConroy BrennanConroy merged commit 74360c7 into master Oct 23, 2019
@BrennanConroy BrennanConroy deleted the brecon/fixups branch October 23, 2019 03:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-signalr Includes: SignalR clients and servers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants