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

OWF.RPC API fails when RPC server is a background widget #28

Open
ghost opened this issue Aug 13, 2013 · 2 comments
Open

OWF.RPC API fails when RPC server is a background widget #28

ghost opened this issue Aug 13, 2013 · 2 comments
Labels

Comments

@ghost
Copy link

ghost commented Aug 13, 2013

RPC client widget will encounter an exception when attempting to call a function that was registered by a background widget. Making the background widget a normal widget and refreshing the browser allows the call to succeed.

Potentially related issue: OWF.getOpenedWidgets() does not return background widgets.

To reproduce:

  1. Create 2 normal widgets, one as a RPC server and the other as a client. Ensure OWF.RPC.registerFunctions() is called before OWF.notifyWidgetReady(); and both are preformed within OWF.ready() on the server widget. The client widget can use OWF.Launcher.launch() to ensure the first widget is launched and also get the instance id via the result.uniqueId in the callback. Said ID can then be used to get the widget proxy. (Using the launcher to get the instance ID avoids a related issue with background widget missing from getOpenWidgets.)
  2. Confirm the client can successfully call a function on the server widget via RPC.
  3. Switch the server widget to a background widget.
  4. Error will occur when client attempts to call RPC function.
@ghost
Copy link
Author

ghost commented Aug 13, 2013

Additionally I have been unable to cause WidgetProxy.onReady() to fire in the client widget whether the RPC server widget is background or not. In both cases I confirmed the server widget was calling OWF.notifyWidgetReady() as it was supposed to.

@ghost
Copy link
Author

ghost commented Aug 13, 2013

Note that publish/subscribe Eventing is available as an alternative communication mechanism and I was able to confirm it works to/from a background widget. One caveat with pub/sub Eventing is the optional third argument to the OWF.Eventing.publish() function does not seem to work reliably when targeting the ID of a background widget and should be omitted. Said problem with the destination argument of the publish() function may be related to this bug.

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

No branches or pull requests

0 participants