< 202022-10-21⋎22 >

Topic for #farmOS is: farmOS (farmos.org) is a free and open source, web-based farm management system. User guide: farmos.org/guide/ - Forum: farmOS.discourse.groupSet by mstenta on 2021-06-15 at 12:52
00:30paul121[m]<symbioquine[m]> "www.drupal.org/project/..." <- Welp that issue is a bit of a dead end. This one goes a step further and suggests the duplicated resource is only ever the 48th entry
00:30paul121[m]www.drupal.org/project/jsonapi/issues/32
00:33symbioquine[m]Yeah, I noticed that it wasn't a super useful issue when I went back to look
00:33paul121[m]I'm able to reproduce the general issue of duplicates:... (full message at <libera.ems.host/_matrix/media/r0/downloa>)
01:20paul121[m]But I'm not seeing this pattern of it happening every 48th entry. Starts at 751 and then every 1-5th entry after (once the 7th entry and once the 10th entry) tends to be a duplicate. My test:... (full message at <libera.ems.host/_matrix/media/r0/downloa>)
01:22paul121[m] * But I'm not seeing this pattern of it happening every 48th entry. Starts at 751 and then every 1-5th entry after (once the 7th entry and once the 10th entry) tends to be a duplicate. My test:... (full message at <libera.ems.host/_matrix/media/r0/downloa>)
01:24paul121[m] * But I'm not seeing this pattern of it happening every 48th entry. Starts at 751 and then every 1-5th entry after (once the 7th entry and once the 10th entry) tends to be a duplicate. My test:... (full message at <libera.ems.host/_matrix/media/r0/downloa>)
01:25mstenta[m]> www.drupal.org/project/jsonapi/issues/32
01:25mstenta[m]worth noting that's for the old `jsonapi` module, not drupal core
01:27paul121[m]that issue also said this issue only appeared when sorting by their `date`, sorting by `date,id` fixed the issue. but no apparent issue w/o sort 🤔
01:28mstenta[m]> www.drupal.org/project/drupal/issues/309
01:28mstenta[m]might be worth reopening and changing the title to make it more specifically about dupes
01:29mstenta[m](better than opening a new one IMO because it has that good first comment from Wim Leers for context/reasoning about why default sorting doesn't work...)
01:32mstenta[m](might also have a better chance of a quick follow up)
01:33mstenta[m]* worth reopening ~and changing, * about dupes~ EDIT: on second thought maybe wait on changing title
01:33mstenta[m]* worth reopening <del>and changing, * about dupes</del> EDIT: on second thought maybe wait on changing title
01:38paul121[m]wow very different behavior when sorting by `created`:... (full message at <libera.ems.host/_matrix/media/r0/downloa>)
01:39mstenta[m]is it reproducible? or are the dupes random each time?
01:40mstenta[m]wait are you getting dupes with sort?
01:42mstenta[m]oh no really?
01:44paul121[m]well JSON:API results are cached as best I can tell. So if run the script immediately again it is the same result (also runs much faster). But if I clear cache, yes I seem to get the same result (dupes in the same order)
01:46mstenta[m]i'm still shocked to hear that you get dupes WITH sort
01:46mstenta[m]that's bad
01:46paul121[m]sorting by `drupal_internal__id` seems to work fine
01:47mstenta[m]oh ok well at least something works
01:52paul121[m]as well as sort by `id`:... (full message at <libera.ems.host/_matrix/media/r0/downloa>)
01:53paul121[m]anything else to test while I'm here?
02:02mstenta[m]log timestamp?
02:03mstenta[m](would require a bit of refactoring)
02:04mstenta[m]but that will be a common one
02:04paul121[m]kinda related issue, just looking for hints: www.drupal.org/project/search_api/issues
02:04paul121[m]> So for me it seems that you need to have an "unique" sorting mechanism attached to get a stable search result.
02:05paul121[m]maybe we need to sort on fields that are unique
02:05paul121[m]there are very likely duplicated `created` timestamps for these plot assets (they are created in bulk)
02:05mstenta[m]true
02:06mstenta[m]can't possibly expect that kind of restriction though
02:07mstenta[m]need to be able to get a list of logs that might have the same timestamp
02:07mstenta[m]and not have dupes
02:09paul121[m]mstenta[m]: I only have 24 logs in my local dev
02:09mstenta[m]oh well 🤷 i imagine it would be the same as `created`
02:10paul121[m]but interestingly I believe the bug report to you and I mstenta was for duplicate logs
02:12mstenta[m]can you point your script at rothamsted?
02:13paul121[m]yeah I suppose so
02:13paul121[m]your server ready? turn up the juice? :P
02:14mstenta[m]sure - curious to see
02:14mstenta[m](famous last words)
02:26paul121[m]2k input logs
02:29symbioquine[m]Turn down the page size to increase the likelihood of duplication where the timestamps fall across page boundaries.
02:32paul121[m]mstenta: is it rate limited?
02:34mstenta[m]nope
02:37paul121[m]hmm. just going kinda slow but I get this for `timestamp`:... (full message at <libera.ems.host/_matrix/media/r0/downloa>)
02:39paul121[m] * hmm. just going kinda slow but I get this for `timestamp`:... (full message at <libera.ems.host/_matrix/media/r0/downloa>)
02:40symbioquine[m]mstenta[m]: I thought you were doing some throttling: farmos.discourse.group/t/sensor-data-sto
02:41mstenta[m]> going kinda slow
02:41mstenta[m]well jeez you don't need to insult me 🙄😆
02:42mstenta[m]symbioquine: i do rate limit data stream posts
02:43paul121[m]hahah well it was a pretty consistent # seconds/page, I wasn't sure
02:46paul121[m]<symbioquine[m]> "Turn down the page size to..." <- worse!... (full message at <libera.ems.host/_matrix/media/r0/downloa>)
02:47paul121[m]so maybe that is a hint, duplicates relative to page boundaries? hmm
02:47mstenta[m]post these results to the d.o issue and reopen it (IMO)
02:48mstenta[m]seems like a pretty critical issue
02:48mstenta[m]wonder if it would be worth pinging @e0ipso in slack to see if he has any ideas where to start
02:48mstenta[m]i saw an issue by him when i was searching earlier that suggested this might be complicated
02:48paul121[m]I've got to run but will try and add later tonight or tomorrow!
02:50mstenta[m]www.drupal.org/project/drupal/issues/297
02:50mstenta[m](maybe unrelated to this, and i haven't read it thoroughly, just gave me the sense that there are some tricky structural considerations with pagination generally)
02:51mstenta[m]symbioquine: just to confirm... you found this originally outside the context of farmOS.py correct?
02:53mstenta[m]another related concern that comes to mind... in a site with high usage (eg: automated log creation), would this make pagination unreliable more generally?
02:53mstenta[m]eg: if logs are being added WHILE you are requesting pages
02:53symbioquine[m]mstenta[m]: yep
02:54mstenta[m]> another related concern that comes to mind... in a site with high usage (eg: automated log creation), would this make pagination unreliable more generally?
02:54mstenta[m]and if so... would a solution be to add your own "greater than" filter and bypass pagination entirely?
02:54symbioquine[m]mstenta[m]: yeah, I think that's a general (and unsolvable) problem with this style of pagination.
02:54symbioquine[m]> <@mstenta:matrix.org> > another related concern that comes to mind... in a site with high usage (eg: automated log creation), would this make pagination unreliable more generally?
02:54symbioquine[m]>
02:54symbioquine[m]> and if so... would a solution be to add your own "greater than" filter and bypass pagination entirely?
02:54symbioquine[m]Yes, I think that would work
02:54mstenta[m]maybe that's what farmOS.py should do then... enforce a sort field, and always use a greater than filter with it
02:55symbioquine[m]You could keep requesting first pages of 50 where the timestamp filter of each page request is derived from the last log/asset in the previous request.
02:55mstenta[m]which is ironic because of this statement on the official pagination docs page:
02:55mstenta[m]> If you take only one thing away from this guide, it should be that **you should not construct your own pagination URLs.**
02:55mstenta[m]www.drupal.org/docs/core-modules-and-the
02:55symbioquine[m]hahaha
02:55mstenta[m]🤦
02:56symbioquine[m]symbioquine[m]: Of course, this also has the flaw that if the data is modified such that a log's timestamp changes between page requests the same log could occur in multiple of those pages.
02:56mstenta[m]paul121: actually now that i think of it I think this is what Octavio ended up doing
02:56mstenta[m]symbioquine: yea, can't avoid everything like that i guess
02:56symbioquine[m]mstenta[m]: Yeah, it's a universal problem with paginating over datasets which don't expose an overall version pointer as part of the pagination API.
02:56mstenta[m]yea.
02:56mstenta[m]and why you set up your script to run via cron when all the farmers are sleeping :-P
02:56symbioquine[m]symbioquine[m]: i.e. if you have a dataset which is immutable and you can paginate over a specific revision pointer for the dataset as a whole, then you can get consistent pagination 🤓
02:59mstenta[m]paul121: we should also let Had know that she may still get dupes
03:40paul121[m]<mstenta[m]> "paul121: we should also let..." <- Oh? I think the internal ID is okay. Maybe I missed something?
03:41mstenta[m]oh right. she's using that?
03:41mstenta[m]so strange that it's ok with some fields (unique only?) but not others
03:46symbioquine[m]One of those problems I was talking about goes away if the field you're sorting on is unique and immutable.
03:46mstenta[m]"those problems" plural? what else besides dupes?
03:47symbioquine[m]Different ways dupes can occur. Concurrent modifications vs indeterminate sort ordering.
03:52symbioquine[m]If they're unique, immutable, and always increasing/decreasing in value then all the problems go away :)
08:43*FarmerEd[m] has quit (Quit: Bridge terminating on SIGTERM)
08:43*paul121[m] has quit (Quit: Bridge terminating on SIGTERM)
08:43*jgaehring[m] has quit (Quit: Bridge terminating on SIGTERM)
08:43*ircwaves[m] has quit (Quit: Bridge terminating on SIGTERM)
08:43*lauriewayne[m] has quit (Quit: Bridge terminating on SIGTERM)
08:43*symbioquine[m] has quit (Quit: Bridge terminating on SIGTERM)
08:43*mstenta[m] has quit (Quit: Bridge terminating on SIGTERM)
08:43*EricLarese[m] has quit (Quit: Bridge terminating on SIGTERM)
08:43*skipper_is[m] has quit (Quit: Bridge terminating on SIGTERM)
08:43*scrdcow[m] has quit (Quit: Bridge terminating on SIGTERM)
08:43*EvanKelley[m] has quit (Quit: Bridge terminating on SIGTERM)
08:43*evered[m] has quit (Quit: Bridge terminating on SIGTERM)
08:43*riotmiked[m] has quit (Quit: Bridge terminating on SIGTERM)
08:43*nzsnowman[m] has quit (Quit: Bridge terminating on SIGTERM)
08:43*Mo[m]1 has quit (Quit: Bridge terminating on SIGTERM)
08:43*zackmuma[m] has quit (Quit: Bridge terminating on SIGTERM)
08:43*lordeddi[m] has quit (Quit: Bridge terminating on SIGTERM)
08:43*donblair[m] has quit (Quit: Bridge terminating on SIGTERM)
08:43*calbasi[m] has quit (Quit: Bridge terminating on SIGTERM)
08:43*dazinism[m] has quit (Quit: Bridge terminating on SIGTERM)
08:43*spitz234[m] has quit (Quit: Bridge terminating on SIGTERM)
08:48*calbasi[m] has joined
09:16*spitz234[m] has joined
09:16*dazinism[m] has joined
09:16*jgaehring[m] has joined
09:16*ircwaves[m] has joined
09:16*zackmuma[m] has joined
09:16*riotmiked[m] has joined
09:16*FarmerEd[m] has joined
09:16*skipper_is[m] has joined
09:16*EricLarese[m] has joined
09:16*lauriewayne[m] has joined
09:16*paul121[m] has joined
09:16*donblair[m] has joined
09:16*EvanKelley[m] has joined
09:16*mstenta[m] has joined
09:16*lordeddi[m] has joined
09:16*evered[m] has joined
09:16*scrdcow[m] has joined
09:16*symbioquine[m] has joined
09:16*Mo[m]12 has joined
09:16*nzsnowman[m] has joined
15:48*uploaded a video: (193KiB) < libera.ems.host/_matrix/media/r0/downloa >
15:57mstenta[m]this is truly a thing of beauty
15:58symbioquine[m]Thanks!
15:58mstenta[m]when asset link blog post symbioquine ??
15:58mstenta[m]😄
15:58symbioquine[m]Good idea, soon (now) I guess...
15:58mstenta[m]Need to show the QR scanning bit to really set the stage
16:00mstenta[m](We need a QR module which auto generates codes for each asset AND offers bulk printing option)
16:00FarmerEd[m]And the camera image importing
16:00mstenta[m]Then you just print em, cut em out, stick em on!
16:00mstenta[m]Put some postage tape over it for weather proofing - bam! good for a few seasons in most places!
16:00symbioquine[m]mstenta[m]: Yeah, I had that built into Rabbit Link (the inspiration for Asset Link)
16:01FarmerEd[m]mstenta[m]: Not here
16:02mstenta[m]Haha well maybe I'm thinking inside a barn where the food bin is kept... loosely indoors
16:02symbioquine[m]symbioquine[m]: Needed functionality to filter though. I ended up using the dev tools to remove the codes I'd already printed from the pages.
16:02mstenta[m]I'd put one on my chicken food bin, and one inside the chicken coop door
16:03symbioquine[m]I use this stuff: www.amazon.com/dp/B00NWVGOF4/
16:03FarmerEd[m]mstenta[m]: Even that can be a challenge sometimes.
16:03symbioquine[m]It's not cheap, but its still going strong outdoors ~2 years later (in the sun/rain just stapled to some cedar scrap wood which is drilled/wired on to the fence)
16:04symbioquine[m]I'll take a picture of one in a bit so show...
16:05mstenta[m]The other idea I had a while ago was to see if you could buy plastic QR codes in bulk... just randomly generated UUIDs... and then offer the ability to assign it to an asset in farmOS (so the opposite of generating it in farmOS)
16:05FarmerEd[m]Cool, could be worth a try.... It's either that or I'd need a CNC ingraver
16:05mstenta[m]Someone's gotta be producing weatherproof random UUID QRs right?
16:06mstenta[m]Feels like something pretty easy to mass produce
16:06FarmerEd[m]mstenta[m]: Or they should
16:06mstenta[m]Just get a big box full of em
16:06mstenta[m]Scan one to assign it to an asset, then glue/screw it to something
16:06mstenta[m]Who's feeling entrepreneurial?
16:11symbioquine[m]I've wanted to create/use functionality like that to allow re-using/upcycling QR codes from things like milk jugs that sometimes have unique batch numbers printed on them as QR codes.
16:11mstenta[m]That would be cool!
16:15FarmerEd[m]Collecting QR codes to reuse off of products reminds me of a shortlived games console from the 90's
16:16FarmerEd[m]Only it was barcodes
16:17*uploaded an image: (463KiB) < libera.ems.host/_matrix/media/r0/downloa >
16:18symbioquine[m]The QR code itself has been replaced with a dummy version for privacy/security reasons, but you can get an idea of how well the text has weathered from the "L8" part.
16:18mstenta[m]Remember this thing? pluralistic.net/2022/10/20/benevolent-di
16:18FarmerEd[m]Is that your waterproof paper?
16:19symbioquine[m]FarmerEd[m]: Yeah
16:19mstenta[m]Not bad symbioquine !
16:19symbioquine[m]That's after ~2 years outside south-facing in a field
16:19symbioquine[m]Printed with a standard laser printer
16:21FarmerEd[m]Are you in a typically wet part of the world?
16:22FarmerEd[m]symbioquine[m]: Would need to be, can't imagine inkjet lasting.
16:24symbioquine[m]FarmerEd[m]: ~73 cm of rain per year on average
16:24mstenta[m]paul121: not THAT is a bug report www.drupal.org/project/drupal/issues/309
16:25mstenta[m]s/not/now/
16:27mstenta[m]I am so curious to understand why those duplicates occur... very tempted to put on my Drupal core snorkel 🤿
16:30paul121[m]haha yeah was just coming to post that update. had to jump on a call right as I was wrapping up so I got rushed at the end
16:30paul121[m]going to credit you two 🤝
18:01mstenta[m]Huh. Well according to @bbrala in Slack, something simple to test is commenting out this line: git.drupalcode.org/project/drupal/-/blob
18:03mstenta[m]That would tell us if `TemporaryQueryGuard` is to blame, which was @bbrala's hunch
18:08paul121[m]oh interesting. well I can try real quick...
18:10mstenta[m]yea! sounds like it would be an easy thing to test before digging any deeper
18:17paul121[m]womp. duplicate at the same spot, 751... (full message at <libera.ems.host/_matrix/media/r0/downloa>)
18:18mstenta[m]alright well good to know it's not that... that class looked kinda scary haha
18:18paul121[m]there is really something to be said about sorting by values that are not unique. for example, plots by `created`:... (full message at <libera.ems.host/_matrix/media/r0/downloa>)
18:19paul121[m]not the first page! but the second page, second entry
18:19mstenta[m]can you elaborate? what specifically are you seeing?
18:20mstenta[m](grokking that code, but if you have it summarized in your head...)
18:20mstenta[m]happens a lot when logs have the same created time?
18:20mstenta[m](assets i mean)
18:21paul121[m]Yes, it seems
18:22paul121[m]Also, interesting that it was the second entry on second page (using default page size 50 here). In this core code they query N+1 (51) to see if there is a next page..... so that 52nd entry wasn't included in the first query...
18:22paul121[m]git.drupalcode.org/project/drupal/-/blob
18:22symbioquine[m]I believe you could add a secondary sorting parameter like `drupal_internal__id` to avoid that problem
18:22symbioquine[m]It just needs to make the sorting consistent right
18:23mstenta[m]Mm that makes sense symbioquine
18:23symbioquine[m]www.drupal.org/docs/core-modules-and-the
18:24paul121[m]symbioquine[m]: good idea, that works :-)... (full message at <libera.ems.host/_matrix/media/r0/downloa>)
18:25paul121[m]I gtg entertain puppy, unfortunately JSON:API pagination is not one of his interests
18:25symbioquine[m]paul121[m]: understandably :)
18:27mstenta[m]why not?? 🐶
18:28symbioquine[m]insufficient squirrels and butterflies involved?
18:32*uploaded an image: (35KiB) < libera.ems.host/_matrix/media/r0/downloa >
18:34*BjrnBrala[m] has joined
18:35BjrnBrala[m]just to have this ready should i need to check here or ping ;)
18:36mstenta[m]Hello Björn Brala !
18:36BjrnBrala[m]^^
19:00mstenta[m]Curious all your thoughts on this: www.drupal.org/project/farm/issues/33169
19:01mstenta[m]Just thought of it while investigating JSON:API stuff, so whipped up a quick issue and did a quick skim of our classes
19:42*uploaded an image: (110KiB) < libera.ems.host/_matrix/media/r0/downloa >
19:42mstenta[m]drupup!
19:42paul121[m]<paul121[m]> "I gtg entertain puppy, unfortuna..." <- We'll work our way towards that...
19:48*uploaded an image: (117KiB) < libera.ems.host/_matrix/media/r0/downloa >
19:48symbioquine[m]^ "After a long day programming"
19:59FarmerEd[m]Think she's done for the night.

< 202022-10-21⋏22 >