[17:11:51] bmansurov: :) [17:40:06] Krinkle: o/ I'm in a meeting. Can I ping you a little later? [17:40:15] yeah, no worries [17:40:19] thanks [18:28:45] Krinkle: free to talk? [18:29:46] bmansurov: Yeah [18:29:58] were you able to repro the issue? [18:30:02] bmansurov: I'm creating a basic page now to repro the general behaviour [18:30:09] ok [18:34:44] bmansurov: OK. so I have the general behaviour, in that clicking a link triggers a beacon. [18:34:57] What am I looking for wrt issue or missing [18:36:17] Krinkle: can you put a console.log inside logEvent and see if data is logged to the console? [18:36:48] Krinkle: from my tests, I found that not every piece of data logged. Sometimes nothing is logged. [18:38:00] bmansurov: OK, so I do see two issues: [18:39:19] 1) Because this uses mw.track and there is no preloading, it is very possible that the tab is unloaded by navigation before the lazy-loaded eventlogging code arrives. Thus, despite the event object being fine and stored in mw.track(), the event logging client JS never arrives and never executes, regardless of any logic within there being preserved by the browser. [18:40:04] The browser is pretty simple when it comes to the event loop and unloading of tabs. There is virtually no potential for race conditions. When you have the tick of the event loop, you can block as long as you want (for better or worse). But when it goes async (fetching code from load.php) unless there is something else holding back the page, that's the end of it. [18:40:07] 2) [CitationUsage] Value 6539.89990234375 is the wrong type for property "event_offset_time" (integer expected) [18:40:28] In some cases when I use cmd-click (so that it opens in new tab without unloading), it does reach the EL code, but gets aborted by this. [18:41:13] Krinkle: ok I'll take care of #2. For #1, should I preload event logging code? [18:41:36] If the user is sampled [18:41:52] bmansurov: Do you have a case where some of the individual properties are missing but the rest exists? E.g. some of the computed data from link stats not working or some of the elements appearing to be missing? That's the part I was confused about as I've never seen a browser do that. Afaik there is no JS execution possible while the page is natively tearing down the page. In fact, in most cases that doesn't even happen immediately (it's [18:41:52] cached and can be restored when pressing back). By the time it actually starts tearing down the DOM, the JS engine is long gone. [18:42:29] Krinkle: yes, let me see if I can reproduce it locally first. [18:42:32] It's possible of course that something is missing, but then it's probably something we do, and can fix :) [18:43:24] Yeah, so the default recommendation for EL usage in JS is fine for anything except synchronous/click tracking. [18:45:26] Krinkle: here are the steps to reproduce the missing properties issue: [18:45:38] I have https://en.wikipedia.org/wiki/Book imported locally [18:46:27] Krinkle: in the footer, I click on uplink next to citation #33. [18:46:39] Krinkle: then I click on citation #33 to get back to where I was [18:46:52] Krinkle: then I click on the external link in that citation. [18:47:12] Krinkle: then I see Missing property "link_occurrence", and Missing property "link_url". [18:47:37] Krinkle: some steps like going up and down the page may not be necessary. [18:51:24] OK. checking [18:53:06] I imported the one paragraph with [33] Edwin Mcdowell [18:53:28] but couldn't reproduce it with that when I go from 1) ref list [33] to paragraph, then click to go back to list, then click ext link [18:53:33] I get three events and no errors [18:53:34] I think it's important that the link you're clicking on is at the end of many external links. [18:55:40] Krinkle: sorry, it happens with the citation #30, not #33 [18:55:44] for some reason [18:55:53] OK. I'll try that one [18:56:17] I will note that if 'link_url' is missing, this cannot be due to DOM teardown because that's read from the object passed in, which JS has its own copy of. [18:56:27] Even to the point that it often causes memory leaks [18:56:50] OK [18:58:50] bmansurov: OK. I can repro the issue [18:59:05] clicking the microsoft url results in link_occurrence, link_url missing [18:59:23] ok [18:59:28] bmansurov: and I know why :P [18:59:36] enlighten me [19:00:17] bmansurov: modify setupExtLogging() locally, and console.log(event.target) as the first line of the click event handler, then go straight for clicking the microsoft link [19:01:48] Krinkle: ok I see. [19:01:56] bmansurov: It's the child [19:02:01] which has no href attribute [19:02:04] :) [19:02:16] Krinkle: but you know what, this is just one case. Sometimes other properties are missing. I'll try and find a case. [19:02:21] short answer is: try `this` instead of `event.target` [19:02:40] which is the element matching the selector instead of the click source - I think. [19:03:14] yeah, this is the matched element. [19:04:09] Krinkle: great. I can't seem to find the other issue. For now I'll make this change and see if the issue happens later. [19:04:28] bmansurov: k, let me know :) [19:04:39] Krinkle: so should I pre-load eventlogging code for the first issue? [19:05:44] bmansurov: btw, I noticed clicking the reference jumpers results in { .. link_url: "...?title=Sandbox/Links#cite_note-1" } being logged. Is that intentional, that the jumpers are also tracked links (for moving focus within the page, wiht the current page url embedded in it before #) [19:06:32] bmansurov: Yeah, so for the async issue, you'll need to load it at some point and then call mw.eventLog.logEvent() directly. [19:06:40] Krinkle: yes, that's intentional. the action for those should be upClick [19:08:06] Alternatively, you can follow what Popups and CentralNotice have done, which is to bypass the (relatively heavy) EL client and go directly for navigator.sendBeacon() with wgEventLoggingBaseUri and JSON.stringify(). Only downside is that you won't get the validation/error warnings like the ones that helped us just now. But, if you have a local eventtlogging-devserver instance, youll still get the warnings, just in the CLI outpout rather than [19:08:06] brwoser. [19:08:46] The devserver is basically just a simple python process, that logs to stdout but includes the validation using meta-wiki schemas. [19:09:09] I see [19:10:07] Krinkle: Thanks for your help! I'll put a patch up soon. Please review. [19:10:32] will do. Ping me on IRC early tomorrow if I haven't. (will see it when I wake up, bouncer) [19:11:12] OK [21:16:46] halfak|net_derp: let me know when you are back [21:49:48] kaldari: hi. I have a good news for you. ;) [21:50:08] kaldari: I have a volunteer who will look into Thanks. [21:52:07] kaldari: question. Can the Thanks data be accessed via quarry? (and by data I mean the public portion of the data: timestamp, username_from, userid_from, username_to) [22:13:00] lzia: yes [22:13:55] query the logging_userindex table with log_type, log_action = thanks, thank [22:43:00] Platonides: thanks. playing with it now. :) [22:43:08] :) [23:21:18] Platonides: do you know how I can tell which project the thank was given on? [23:25:14] that's the database you are working on