Skip to content

Conversation

@iislucas
Copy link
Contributor

@iislucas iislucas commented Apr 5, 2015

To be reviewed after: #145 is merged and this pull request is updated to be against the latest head of dev (this pull request builds on that one).

There were a number of places (in uproxy-networking) where peerconnection was being imported just for signaling types; this was bad because it results in huge amounts of confused code in the browserified outputs (e.g. module-environment dependent code in a core env). So, I moved the signal types to their own file and now import only that when needed (done in: UWNetworksLab/uProxy-networking#224)

Note: In merge; noticed that coverage was broken, so that has been fixed too.

Review on Reviewable

@iislucas
Copy link
Contributor Author

iislucas commented Apr 7, 2015

Thanks!

Renamed to signals I think I like that better too.

Sadly your comment on JSON.stringify didn't have a location attached to it (maybe reviewable is better at that), but I'm guessing you're referring to log statements... I've removed JSON.stringify from those locations. I also noticed two potential bugs, fixed one, and added a TODO for the other.

PTAL.

@jpevarnek
Copy link
Contributor

Strange, it's showing up on the line for me...

I think you may have missed another comment I had above:

General note: I would rename all the places you have used s as a variable name to message, I think that is a lot more descriptive (I might also do the same for some of the places the variable is still called signal actually)

@iislucas
Copy link
Contributor Author

iislucas commented Apr 8, 2015

ooo, I did miss that, could call. fixed. PTAL.

@trevj
Copy link
Contributor

trevj commented Apr 8, 2015

I think this is the diff we're looking for:
iislucas-coverageRuleFixes...iislucas-separate-signal

Copy link
Contributor

Choose a reason for hiding this comment

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

You've made this signal:signals.Message in some places, not in others. I prefer signal but we should be consistent.

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 think I'm now using message::signals.Message everywhere.

@jpevarnek
Copy link
Contributor

LGTM

Copy link
Contributor

Choose a reason for hiding this comment

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

"signal message" reads weird..."signalling message" would be better (or "signal" for short).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done.

@iislucas
Copy link
Contributor Author

@trevj: ping?

@trevj
Copy link
Contributor

trevj commented Apr 10, 2015

Sorry! Two easy comments, then 👍.



src/webrtc/peerconnection.ts, line 392 [r4] (raw file):
This TODO does not read well :-)


src/webrtc/peerconnection.ts, line 447 [r4] (raw file):
Indentation, semi-colons, and quotes need attention:

 var descriptionString :string;
 try {
  descriptionString = JSON.stringify(description);
} catch (e) {
  descriptionString = '[unstringifiable object]';
}
this.closeWithError_('Failed to set remote description: ' +
    descriptionString + '; Error: ' + e.toString());


Comments from the review on Reviewable.io

@iislucas
Copy link
Contributor Author


src/webrtc/peerconnection.ts, line 392 [r4] (raw file):
oops, that comment was confused/wrong (only parse needs a try-catch). good catch. removed.


src/webrtc/peerconnection.ts, line 447 [r4] (raw file):
oops, same error here: stringify doesn't throw so this isn't needed. cleaned up.



Comments from the review on Reviewable.io

@iislucas
Copy link
Contributor Author

Thanks for your diligent reviewing; that caught two confusions that nearly crept into the code!




Comments from the review on Reviewable.io

@jpevarnek
Copy link
Contributor


src/webrtc/peerconnection.ts, line 444 [r4] (raw file):
stringify will throw in some cases (at the very least if it is given a recursive data structure)



Comments from the review on Reviewable.io

@iislucas
Copy link
Contributor Author


src/webrtc/peerconnection.ts, line 444 [r4] (raw file):
good point. For these data structures, we are never going to get exceptions; so I'm fine without the runtime-check (we get compile time checking goodness here)



Comments from the review on Reviewable.io

iislucas added a commit that referenced this pull request Apr 10, 2015
Separate signal types from peerconnection
@iislucas iislucas merged commit 01c261b into dev Apr 10, 2015
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.

4 participants