**** BEGIN LOGGING AT Wed Nov 26 02:59:58 2014 Nov 26 16:22:27 Hey, got a puzzler: Using luna-send, I can verify that a watch is fired from DB8 at appropriate times, but the watch is not showing up in our “data-driven” Enyo 2 app: https://gist.github.com/DougReeder/33bcedce8b320956f3fa Nov 26 16:24:40 ServiceRequest is from webos-lib, and the rec param passed to fetch is always an enyo.Collection, so _doRequest is never called here. Nov 26 16:25:32 Key point: the console.log statements in handleFindOrNotificationResponse() are called for the initial find response, but never when the watch fires. Nov 26 16:30:24 My logging in Enyo says I’m sending a query which should produce watch notifications. Nov 26 16:41:51 I see the log statements from the app in /var/log/messages, but nothing from DB8 itself. Is there a way to tell DB8 to log what it’s doing? Nov 26 16:41:51 DougReeder: yep Nov 26 16:42:02 What version of db8 do you use? Nov 26 16:42:36 The version in LuneOS Black Eye… let me check the sources. Nov 26 16:42:40 For old version of db8 - it uses internal logging. For new one - pmloglib. If new one -> you can switch on logging with PmLogCtl function Nov 26 16:43:59 To enable logging with PmLogCtl: # PmLogCtl set DB8 info Nov 26 16:44:54 Okay, that give me PmLogCtl: Setting context level for 'DB8'. Nov 26 16:45:07 How do i view pmlog? Nov 26 16:45:51 now you should see in /var/log/messages some additional logging. But... In release, DB8 will not log too many information. Nov 26 16:45:51 does it show up using jornalctl? Nov 26 16:46:04 by the way Nov 26 16:46:16 What kind of query you execute? **** BEGIN LOGGING AT Wed Nov 26 16:50:22 2014 Nov 26 16:50:53 DougReeder: remove "watch:true" Nov 26 16:50:56 param from query Nov 26 16:51:22 If you want really recieve callbacks for changes by query, you can use db8 "watch" method Nov 26 16:52:10 DougReeder: simple find query: luna-send -n 3 -a com.palm.app.contacts luna://com.palm.db/watch '{"query": {"from": "com.palm.person:1"}}' Nov 26 16:52:17 Or, if you want "watch" for changes Nov 26 16:52:20 It should be Nov 26 16:52:28 Isn’t setting watch true on a find equivalent to calling find (without watch) and watch? Nov 26 16:52:56 DougReeder: find with param "true" is the same as watch Nov 26 16:53:00 but... Nov 26 16:53:10 find with param true is deprecated Nov 26 16:53:18 *find with "watch" param true is deprecated Nov 26 16:53:19 Oh? Why? Nov 26 16:53:33 The docs don’t say so. Nov 26 16:56:07 DougReeder: one minute, maybe I am wrong Nov 26 16:57:37 DougReeder: ups, sorry. Nov 26 16:57:52 DougReeder: db8 find with watch param and watch are the same Nov 26 16:57:55 Absolutly Nov 26 16:58:17 That’s certainly what I expect. Nov 26 16:59:09 Since I can receive the watch notification using luna-send, the problem must lie in my code or ServiceRequest. Nov 26 16:59:23 Hence the gist. Nov 26 16:59:40 DougReeder: I have a gues, that this message not from db8 itself Nov 26 17:00:00 Can you give "full" message? Nov 26 17:00:14 Oh, the webos-lib used here is https://github.com/webOS-ports/webos-lib Nov 26 17:00:28 Soryy, what “full” message? Nov 26 17:01:45 DougReeder: 5 minute, i will fetch webos-lib :-) Nov 26 17:09:49 DougReeder: I am not sure, but for db8 it is not difference, when you call watch or find with param. Absolutly (code are the same) Nov 26 17:10:07 Okay, that’s good to know. Nov 26 17:11:43 I added a separate Watch request, and it gets a NotificationResponse right away (which isn’t useful, aside from knowing I can get responses). Nov 26 17:17:59 Having run “PmLogCtl set DB8 info”, is there a way to filter the log for only DB8 messages? Nov 26 17:22:01 DougReeder: by default, pmlog should log all db8 stuff into /var/log/messages. You can simply run: tail -f /var/log/messages | grep -i db8 Nov 26 17:24:13 That shows messages from our app which contain /db8/ , but nothing from DB8 itself. Nov 26 17:27:25 DougReeder: the main problem, that if db8 compiled in release, it may do not log anything Nov 26 17:27:37 * DougReeder nods Nov 26 17:27:38 DougReeder: You run your app on device Nov 26 17:27:43 ? Nov 26 17:27:45 * DougReeder nods Nov 26 17:28:09 I can recompile it - what flag would I change, and where? Nov 26 17:28:34 Heck, we should be doing that in the dev builds anyway. Nov 26 17:32:18 db8 source: $ cd build && cmake -DCMAKE_BUILD_TYPE=debug -DPMLOGLIB_ENABLE_LOGGING=true .. Nov 26 17:32:21 try this Nov 26 17:33:47 Thanks, I’ll need to ask some other team members wher to put that in bitbake. Nov 26 17:34:59 DougReeder: Bad idea to add this into dev. builds :-0 Nov 26 17:35:01 :-) Nov 26 17:35:35 Dev builds spam the log with lots of stuff - I can’t imaging this adding that much. Nov 26 17:36:08 The main reason, why this compilation flag is disabled -> with this flag db8 produce a LOT of messages, and whole webos build (even dev) build became very slow Nov 26 17:36:40 with this param db8 log everything, even indexes / keys and log internal checks Nov 26 17:36:58 Oi! Nov 26 17:36:58 Hey, gotta lunch appt, back in a hour. Thanks! Nov 26 17:37:13 DougReeder: ;-) Nov 26 17:37:25 No param to just log requests? Nov 26 17:47:37 DougReeder: unfortunally db8 haven't such "flag" Nov 26 19:35:54 webosos Nov 26 19:36:01 * DougReeder returns Nov 26 19:36:14 i wonder what the userbase is like now Nov 26 19:36:41 * dwc still has a pre2 Nov 26 19:37:13 don't see how you can still use one but thats none of my business Nov 26 19:37:46 I make phone calls, I use feedreader and minor use of the web browser Nov 26 19:38:18 occasional use of gvoice for sms, mostly read-only on email Nov 26 19:38:21 these days phones can do a lot more Nov 26 19:38:44 yep Nov 26 19:39:19 when the lights are turned off i guess you will still stick to it Nov 26 19:39:41 I'll need to remember to deconfigure some palm stuff, but yea, I don't make use of much Nov 26 19:39:48 I gave up a while ago Nov 26 19:40:16 I had to laugh when HP put the "no more updates" in there... when was the last time we've seen an update anyways? Nov 26 19:41:11 i thought it was no more app updates Nov 26 19:41:29 when i look at webos it looks the same as when i got it back in 2009 Nov 26 19:41:50 FAQ - webOS Shutdown Nov 26 19:41:55 Q: Will I get system updates? Nov 26 19:41:55 A: No. There will be no further system updates available. Nov 26 19:42:12 oh, I guess maybe they're talking about an OTA Nov 26 19:42:48 I guess sometime between now and then I'll have to pull copies of the doctors for all my devices Nov 26 19:42:56 (the ones I don't have) Nov 26 19:43:53 (I'm guessing I have almost all of them downloaded already) Nov 26 21:27:45 Feniksa , “ls-monitor -f com.palm.db” does what I want. Nov 26 21:32:30 yep Nov 26 21:32:37 Sorry for long response, was out of office Nov 26 21:32:44 * DougReeder nods Nov 26 21:33:20 DougReeder: by the way, did you found solution of your problem? Nov 26 21:34:44 Not yet.I see the original requests followed by a suspicious-looking com.palm.luna-9999 (/var/run/ls2/Rx5GRi) com.palm.db (/var/run/ls2/Df3Got) /com/palm/luna/private/cancel «{"token":96}» Nov 26 21:35:17 96 being the sequence number for the find. Nov 26 21:35:42 Is that a request to cancel an earlier request? Nov 26 21:37:16 DougReeder: not sure. Ok, lets start from other side. You subscribe for some data from db8, but db8 doesn't return it? Nov 26 21:37:42 Find w/ watch works fine using luna-send. Nov 26 21:38:18 but it doesn't work, if you try to get it via enyo? Nov 26 21:38:34 An apparantly identical request sent using ServiceRequest from Enyo-2 receives the first response, but no later responses. Nov 26 21:40:33 DougReeder: 1 min Nov 26 21:41:01 I’m wondering if ServiceRequest is not meant to be used fro subscriptions by itself. Nov 26 21:56:40 When I make the find request using luna-send, it is *not* followed by cancel Nov 26 21:57:04 I think I need to look into enyo.Async Nov 26 21:57:16 …and try another service. Nov 26 21:58:55 DougReeder: I don't know, how works ServiceRequest. But I can explain, how works db8 Nov 26 21:59:23 when some service "watch" for some updates in db8 by query Nov 26 21:59:56 if db8 found record, it return to service and cancel subscription. Nov 26 22:00:02 If db8 doesn't found record for watch Nov 26 22:00:12 then db8 will keep subscription. Nov 26 22:01:00 If some service put new object, and db8 match for query, then db8 will notifie subcriber and after that cancel subsription Nov 26 22:01:08 *notify Nov 26 22:02:28 So, a pure “watch” request should be crafted to initially find no records? For example, by using a _rev numver higher thatn any known? Nov 26 22:02:59 That would explain my watch request returning right away. Nov 26 22:07:14 The luna-sned request, after receiving 2 responses (as specified), issues a cancel. Nov 26 22:11:25 So, luna-send issues a cancel after receiving the designated # responses, while ServiceRequest is cancelling immediately. Nov 26 22:17:58 Think about watch something like: My service want to be notified about some change. For example, change of system locale. It executes: com.palm.db/watch "{"query": {"..."}}"; If such object Nov 26 22:18:07 found, db8 will return "fire" Nov 26 22:18:33 If such object not found, it will return subscriber only when such object will exist Nov 26 22:18:46 I agree, not clear logic with watch Nov 26 22:20:11 DougReeder: Can you write some bash script, how to reproduce it? Nov 26 22:21:02 Hmm, could write a bash for luna-send, but that works as expected. Nov 26 22:21:38 The webos-lib ServiceRequest is not scriptable from bash. Nov 26 22:22:30 DougReeder: ah... thats bad. I don't know anyone, who can help you with webos-lib. Nov 26 22:22:56 Did you try to ask the same at openwebos channel? Nov 26 22:23:10 Currently, I’m focussing on webos-lib. I should be able to track down the authors, once I’m sure that’s the problem. Nov 26 22:24:08 Not yet; this channel seemed more appropriate, and people connect to both. Nov 26 22:25:00 DougReeder: heh. Just looked to commiters list for webos-lib. Nov 26 22:25:06 I don't know anyone from them :-) Nov 26 22:26:00 Thanks for explaining the watch request - its behavior makes sense in its intended usage. Nov 26 22:27:48 DougReeder: no problem :-) By the way, if you will have any question - fill free to ask. But I can help only with some "core" components, like db8 or luna Nov 26 22:28:00 * DougReeder nods Nov 26 22:28:06 I am not familiar with enyo stuff Nov 26 22:28:10 in webos Nov 26 22:30:13 There’s a lot of moving parts, but they mostly make sense. Nov 26 22:34:28 Subscribing to com.palm.wifi/findnetworks using luna-send get a response every second or two. Using webos-lib ServiceRequest, it returns one response only. Nov 26 22:34:57 So, webos-lib ServiceRequest appears be the problem, clearly. **** ENDING LOGGING AT Thu Nov 27 02:59:59 2014