You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed an issue in fetch where a client could request data from the other side of an iframe but never receive a response. A quick code example:
// in the outer framevarbellhop=newBellhop();bellhop.connect();bellhop.fetch('ping',e=>console.log('Received',e.data));
// in the inner framevarbellhop=newBellhop();bellhop.connect();// bellhop.respond('ping', 'pong')
In this case, the callback will never be called. This to me makes sense because it's asking the other side "if you have data, please provide", rather than "I need this data in order to move forward". However, I can see a case (UserData in springroll core for example), where it might be useful for the requestor to know if there isn't anyone listening on the other side so the app can respond accordingly.
The solution in my mind is to potentially add a timeout before eventually rejecting the event. However, I don't see any mechanism through the callback system to notify the requestor that it was an error, rather than an "real" response from the other side. What would be the correct approach?
The text was updated successfully, but these errors were encountered:
I noticed an issue in
fetch
where a client could request data from the other side of an iframe but never receive a response. A quick code example:In this case, the callback will never be called. This to me makes sense because it's asking the other side "if you have data, please provide", rather than "I need this data in order to move forward". However, I can see a case (
UserData
in springroll core for example), where it might be useful for the requestor to know if there isn't anyone listening on the other side so the app can respond accordingly.The solution in my mind is to potentially add a timeout before eventually rejecting the event. However, I don't see any mechanism through the callback system to notify the requestor that it was an error, rather than an "real" response from the other side. What would be the correct approach?
The text was updated successfully, but these errors were encountered: