**** BEGIN LOGGING AT Mon Jan 19 02:59:58 2015 Jan 19 08:08:13 Herrie: ping Jan 19 08:17:26 morphis: pong Jan 19 08:37:06 Herrie|Veer: you already started with 797? Jan 19 08:38:34 morphis: Not yet Jan 19 10:24:42 morning Jan 19 10:25:02 Garfonso: morning Jan 19 10:36:32 Garfonso: you already had time to look at the InAppBrowser support? Jan 19 13:43:55 DougReeder: https://bpaste.net/raw/f5b454516121 Jan 19 13:44:08 DougReeder: that is the output after I added logging to the PalmServiceBridge Jan 19 13:57:57 not yet sure what it caused to destroy all those PalmServiceBridge objects Jan 19 14:05:18 Cage1___: ping Jan 19 14:31:35 Hi morphis Jan 19 14:35:44 \whois Cage1__ Jan 19 14:36:22 Sorry Cage1__ ..... noobie here Jan 19 14:37:13 Cage1___: we started to document the messagings bits Jan 19 14:37:27 not sure if you saw that Jan 19 14:37:31 https://github.com/webOS-ports/org.webosports.messaging/wiki/Features Jan 19 14:37:35 https://github.com/webOS-ports/org.webosports.messaging/wiki/Implementation-aspects Jan 19 14:37:39 https://github.com/webOS-ports/org.webosports.messaging/wiki/Testing Jan 19 14:40:21 Okay I'll take a look thanks for letting me know Jan 19 14:59:58 morphis, I notice the log reads “created (subscribe 0 identifier org.webosports.app.testr 1004 privileged 1)” and “destroying (identifier org.webosports.app.testr 1004 privileged 1 subscribed 0)” - the request is not flagged as subscribed. Jan 19 15:08:06 Logging shows that subscribe:true is passed to PalmServiceBridge. What project is the source code for that in? Jan 19 15:10:01 morphis: tried it right now (on emulator). Page loads, but my callbacks are not called. Maybe I did something wrong, will look at it again later Jan 19 15:11:14 DougReeder: yeah, that field is never set or used so simply ignore it Jan 19 15:11:45 Garfonso: could be that something is still wrong the imlementation Jan 19 15:12:01 How, then, are subscriptions set? Jan 19 15:13:14 it depends on how you call LS Jan 19 15:13:21 on the C level there is a LSCall Jan 19 15:13:30 which will give you multiple replies, so subscriptions Jan 19 15:13:46 and a LSCallOneReply which only gives you 1 reply and then cancels the call Jan 19 15:14:00 basically there is nothing different between a normal and a subscribe call Jan 19 15:14:23 there is just the agreement between both sides that multiple replies are send and expected Jan 19 15:21:20 So, from which side does the message “…PalmServiceBridge[0x4d165d20]: created (subscribe 0…” come? Jan 19 15:22:01 that comes from the WebProcess which does the processing of the webpage Jan 19 15:22:36 DougReeder: https://github.com/webOS-ports/qtwebkit/commit/3a2cb4770cdee45cbc58a2b28ecaf7706a5cd32d Jan 19 15:23:07 that is called when some creates a PalmServiceBridge object Jan 19 15:23:48 So, the “subscribe: 0” has no relation to whether it will send multiple resopnses? Jan 19 15:25:17 right Jan 19 15:25:46 look at https://github.com/webOS-ports/qtwebkit/blob/3a2cb4770cdee45cbc58a2b28ecaf7706a5cd32d/Source/WebCore/platform/webos/PalmServiceBridge.cpp where it is used Jan 19 15:26:19 the actual call is made from here: https://github.com/webOS-ports/qtwebkit/blob/3a2cb4770cdee45cbc58a2b28ecaf7706a5cd32d/Source/WebCore/platform/webos/LunaServiceMgr.cpp#L244 Jan 19 15:35:47 DougReeder: not sure yet where the actual the origin of our bug is but it looks like something destroys the PalmServiceBridge object and then the call gets canceled Jan 19 15:36:08 DougReeder: could it be an js scope issue? Jan 19 15:36:52 There’s a PalmServiceBridge object in JS-land and also in C++-land? Jan 19 15:37:40 Potentially, the JS PalmServiceBridge object might be garbage-collected. Jan 19 15:37:56 DougReeder: the js one is mapped to the C++ one Jan 19 15:38:17 you directly interface always with the C++ directly Jan 19 15:39:39 https://github.com/webOS-ports/webapp-launcher/blob/7e266014cab64b45f3110324ee11d2e6971fd286/src/extensions/PalmServiceBridge.js#L20 should keep the JS object from being garbage-collected. Jan 19 15:40:32 DougReeder: ignore that code Jan 19 15:40:35 that is pretty old Jan 19 15:40:49 also webapp-launcher isn't used anymore Jan 19 15:41:01 DougReeder: https://github.com/webOS-ports/luna-webappmanager is what we use today Jan 19 15:43:21 So, where is window.PalmServiceBridge created then? Jan 19 15:43:36 it's expose from C++ Jan 19 15:43:42 s/expose/exposed/ Jan 19 15:44:22 the idl https://github.com/webOS-ports/qtwebkit/blob/webOS-ports/master/Source/WebCore/platform/webos/PalmServiceBridge.idl describes the interface to the js side Jan 19 15:44:32 and the C++ class backs it with the actual implementation Jan 19 15:44:48 so a new PalMServiceBridge() goes directly to the c'tor of the C++ class Jan 19 15:53:42 So, if something is being garbage-collected when it shouldn’t, it’s happening on the C++ side. Jan 19 15:54:51 but shouldn't the js side keep a reference on the object? Jan 19 15:56:14 Well, I’m not sure what magic goes on for JS native objects. They are very different from standard JS objects. Jan 19 15:57:12 really? Jan 19 15:57:26 … despite presenting a compatible API to JS-land Jan 19 15:58:15 normally as long as someone keeps an reference things should be kept Jan 19 15:59:38 window.PalmServiceBridge is a reference, but is that a constructor ? Jan 19 16:00:00 Is some kind of object created for each PalmBus call? Jan 19 16:00:06 its a class Jan 19 16:00:11 yes Jan 19 16:01:34 So, I’m not seeing any mechanism on the JS side to keep a reference to the per-call objects. Jan 19 16:03:33 DougReeder: https://github.com/webOS-ports/webos-lib/blob/master/source/ServiceRequest.js#L47 Jan 19 16:04:02 Ah, okay Jan 19 16:11:37 I think I’ve been confused by varying terminology - PalmServiceBridge vs. request. Jan 19 16:25:34 Sorry, my terminology was backward (based on a talk I attended a few years ago). A C++ object is a *host* object (like window). An object that lives purely in JS-land is a native object. Jan 19 16:26:29 But, in general, host objects don’t have to obey any of the rules of JS - they just have an interface you can call from JS. Jan 19 16:48:28 I’m working on an approach, based on keeping references to the ServiceRequest objects. Initially, this looks promising. I need to think about whether this is the “right” approach. Jan 19 16:49:10 Differences in garbage collection could explain why the same code behaves differently on different versions of the OS. Jan 19 16:56:17 DougReeder: also the implementation of the PalmServiceBridge can be different Jan 19 16:57:44 * DougReeder nods Jan 19 19:38:00 morphis: Any chance you could trigger a new build with the audio service PR included so I can work on the QML side of things + integrate the sounds at the same time? Jan 19 19:38:59 Herrie: yeah Jan 19 19:44:50 Herrie: build triggered Jan 19 19:54:07 Great Jan 19 22:20:52 morphis: I can't get the callbacks to be called. You can use this to try: https://github.com/webOS-ports/org.webosports.service.contacts.carddav/pull/65 Jan 19 22:24:23 Morphis, it looks like PalmServiceBus and the lower levels are fine. There’s an undocumented need to hold a reference to ServiceRequests. We just never noticed with one-shot requests, since they are usually fulfilled before they get garbage collected. Jan 19 22:26:06 maybe we should add that then, at least if you call via enyo or something. Jan 19 22:26:51 PalmService should be updated to always hold a reference, not just for subscribed request. Jan 19 22:27:14 yes, something like that. :) Jan 19 22:27:41 And the docs for ServiceRequest should heavily emphasize this - otherwise, programs are likely to have unreproducible bugs in low memeory situations. Jan 19 22:28:25 morphis: Seems Mako build failed again :S Jan 19 22:28:35 "ERROR: Required kernel image is not available as fastboot image!" **** ENDING LOGGING AT Tue Jan 20 02:59:59 2015