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

safari: fix createOffer callbacks API #860

Merged
merged 1 commit into from
Aug 2, 2018

Conversation

dagingaa
Copy link
Collaborator

@dagingaa dagingaa commented Aug 2, 2018

This change fixes a bug where the legacy callbacks API for Safari
createOffer didn't return as expected when compared to the currently
working promises API.

This was due to the order of shims in adapter_factory, where the
shimCreateOfferLegacy which does trasceiver stuff and overwrites the
createOffer prototype was called after shimCallbacksAPI already fixed
the createOffer function to support callbacks.

Moreover, this happened only because the order of arguments to
createOffer int he first place, where the callbacks come first (wtf)
before the options, meaning that the options argument changes order
between the callback and promise API. If only we could go back in
time...

Fixes #859

Description

Purpose

This change fixes a bug where the legacy callbacks API for Safari
createOffer didn't return as expected when compared to the currently
working promises API.

This was due to the order of shims in adapter_factory, where the
shimCreateOfferLegacy which does trasceiver stuff and overwrites the
createOffer prototype was called after shimCallbacksAPI already fixed
the createOffer function to support callbacks.

Moreover, this happened only because the order of arguments to
createOffer int he first place, where the callbacks come first (wtf)
before the options, meaning that the options argument changes order
between the callback and promise API. If only we could go back in
time...

Fixes webrtcHacks#859
@fippo
Copy link
Member

fippo commented Aug 2, 2018

test failure is due to #857, i'll fix that tomorrow

@fippo
Copy link
Member

fippo commented Aug 2, 2018

the rationale for the old order was that you always want a callback (because you need the sdp) but only sometimes need to specify options.

@fippo fippo merged commit 81d6801 into webrtcHacks:master Aug 2, 2018
@fippo
Copy link
Member

fippo commented Aug 2, 2018

will do a new release tomorrow after fixing #857.

Also for tradition sake: 🍰

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CreateOffer only works with promises in Safari 11.1.2
3 participants