< 262022-09-27⋎28 >

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
03:10*farmBOT has joined
14:36mstenta[m]symbioquine: Hey! Just realized the farmOS map HCD call is tomorrow at 3 pm Eastern - not sure if you were included on the invite this time - can you join us?
14:36mstenta[m]paul121: it would be great to have you too!
14:36symbioquine[m]* Wasn't invited (yet)
14:36symbioquine[m]* Happy to join :)
14:37mstenta[m]Ah! OK I'll tell Sienna to add you
14:37mstenta[m]Great!!
15:18mstenta[m]paul121: What do you think about this? github.com/farmOS/farmOS/pull/575#discus
15:18mstenta[m]I tested that with farmOS core and it seems like that would capture all the fields we want to affect.
15:18mstenta[m]Running it now on the PODS code to double check that one...
15:25mstenta[m]paul121: I know I said to get PRs together for 2.0.0-beta7 but go easy on me haha!
15:25mstenta[m]Dunno if we'll be able to merge everything this week.
15:25paul121[m]I don't have any more :-)
15:26symbioquine[m]I'll try to review the map related PRs later this morning (PST)
15:26mstenta[m]Do we need to squeeze those ones in for beta7 or could they wait?
15:26paul121[m]<mstenta[m]> "I tested that with farmOS core..." <- yeah, seems like that should work. I wonder if there is a way to get the field "column name" instead of the "field name" ? That might be the more generic solution
15:27symbioquine[m]mstenta[m]: It would be cool to get them in since they potentially enable building some totally new map-related workflows
15:27paul121[m]mstenta[m]: It would be nice but I can patch if we can't get them in
15:28paul121[m]do you guys have an easy way to test a map in a modal/off-canvas dialog?
15:28mstenta[m]Feels like a number of different things that might need more consideration time than I can give this week
15:28paul121[m]I was going to try and find something that doesn't involve custom code
15:28mstenta[m](for a feature that I don't need yet haha)
15:29mstenta[m]But I agree it would be great!
15:29mstenta[m]If symbioquine can help review then I'm game to try!
15:29paul121[m]paul121[m]: tldr add this to an action link or task link definition that links to a page with a map:... (full message at <libera.ems.host/_matrix/media/r0/downloa>)
15:29mstenta[m]I guess it's mainly the resize one that I feel needs the deepest thought
15:30mstenta[m]paul121: can the Gin CSS one wait?
15:30mstenta[m]Just trying to triage what I need to focus on in the limited time I have
15:31symbioquine[m]mstenta[m]: Yeah, I was wondering if 3 seconds is enough...?
15:31paul121[m]mstenta[m]: oh yeah not important. that will be a breaking change with Gin v4
15:33paul121[m](although they did seem to merge the breaking change into 3.x-dev which confuses me... I think the backwards compatibility layer still needs to be committed)
15:38paul121[m]<symbioquine[m]> "Yeah, I was wondering if 3..." <- I actually had it at 5 seconds and changed it to 3 before I pushed :D
15:38paul121[m]I kinda think 3 seconds is overkill. For me (on a relatively quick computer) it seems to only need the 0.5 seconds. I think we only need to account for the time between map creation & when the map is added to the dialog element. Not sure how that works though... I believe the internals of this are buried inside the jQuery Dialog UI library
15:39symbioquine[m]So no network latency involved?
15:39mstenta[m]timeouts give me the heebie jeebies
15:39mstenta[m]events are the proper solution
15:39mstenta[m]but i get the avoidance of jquery
15:40mstenta[m]but... maybe we include it only for this case?
15:40mstenta[m](still haven't fully reviewed the code, just thinking out loud)
15:40mstenta[m]or somehow leave this up to the code implementing it?
15:41paul121[m]symbioquine[m]: I did a little test! (see PR). It seems that it doesn't matter though. It took much longer than 3 seconds to load everything, particularly it took more than 3 seconds to render the map *after* farmOS-map.js was loaded & it still worked.
15:42paul121[m]mstenta[m]: It's just hard to only identify this case :-/
15:43mstenta[m]Right.
15:43mstenta[m]One thought might be to provide a `#detect_resize` property that adds the extra JS or something
15:43mstenta[m](not saying that's good... just thinking through)
15:44paul121[m]One question: does calling `map.updateSize()` do anything "bad" if it doesn't need to be updated? I think that is what we want to avoid?
15:44mstenta[m](would obviously be better if devs didn't need to worry about this... but i think the event is the "right" way to do that. timeouts are risky and generally bad practice as I understand it)
15:44mstenta[m]Probably not? Just extraneous processing I suppose.
15:45paul121[m]mstenta[m]: The issue is that any page could be loaded into a dialog. For example iirc, how Pedro loads the log edit form into off-canvas
15:45paul121[m]mstenta[m]: But! We can first check if the map "has a size". If it does, no need to update.
15:46paul121[m]So then we are only "updating the size" for maps intended to be hidden, which yeah is extra processing
15:47paul121[m](might need a slight change in my PR to ensure we only update if needed)
15:47mstenta[m]It seems like the core issue here is that the current event system uses jQuery, right? I wonder if there's a plan to move away from jQuery?
15:48paul121[m]mstenta[m]: yeah let me see if I can find the issue... but it is a ways out
15:49paul121[m]www.drupal.org/project/drupal/issues/317
15:51mstenta[m]I don't love the idea of adding jQuery, but it feels like that might be the "right" approach to this. With the expectation that the jQuery dependency will be removed upstream eventually.
15:52mstenta[m]Maybe here's another question: is jQuery already being included for other things in most of the pages that use maps?
15:52mstenta[m]Maybe adding jQuery won't actually change anything right now.
15:53paul121[m]Yeah it is. Gin still uses it, but will be removing it soon. There are likely other things using jQuery too, though
15:54paul121[m]But... I actually tried using the jQuery event and seemed to have the same issue. The map isn't included in the dialog yet
15:55paul121[m]Anyways, yeah this would be a nice to have for 2.7, certainly other things are a priority
15:56paul121[m](eg: maps don't even work in the dialog without fixing chunk loading)
15:56mstenta[m]?
15:56mstenta[m]Ok yea I was gonna say maybe you can find a way to do this in a custom module until we can give this more thought
15:57paul121[m]I think I'll just patch instead haha there isn't really another easy way
16:10evered[m]If anyone needs database (SQL) eyes, I am happy to give a look.. I have a master's in computer science with emphasis database systems.
16:10evered[m]unless farmOS uses ORM...
16:13symbioquine[m]evered[m]: Maybe you have inputs regarding how bad in practice the extra joins will be in [this PR](github.com/farmOS/farmOS/pull/571) from a performance/potential-DOS perspective...
16:16evered[m]multiple joins can be an extreme bottle-neck... please stand by folding laundry
16:22*polo__ has joined
16:57*polo__ has quit (Read error: Connection reset by peer)
17:10*polo__ has joined
17:13mstenta[m]evered: Agreed - what this does is balances that against the need to remove duplicate rows when a filter is applied.
17:14mstenta[m]paul121: What do you think of this? github.com/farmOS/farmOS/pull/575/files
17:14mstenta[m]Works in all the testing I've tried.
17:20*polo__ has quit (Read error: Connection reset by peer)
17:38*polo__ has joined
17:47mstenta[m]paul121: any qualms with me merging github.com/farmOS/farmOS/pull/537?
17:47mstenta[m]Or should we wait?
17:54paul121[m]I haven't tested the code myself but if it works then it seems like it should be ready!
18:19symbioquine[m]<symbioquine[m]> "I'll try to review the map..." <- Might be running a bit late on this... Internet is down here 🥺
18:25*polo__ has quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
18:30mstenta[m]No worries symbioquine
18:41*polo__ has joined
18:51mstenta[m]I have the following PRs lined up to merge:... (full message at <libera.ems.host/_matrix/media/r0/downloa>)
18:55mstenta[m]paul121: Should I take the time to review github.com/farmOS/farmOS/pull/573 or is it ok to do that in the next release? Are you waiting on it for anything? (Haven't looked closely... just triaging right now)
18:59paul121[m]That can wait until next release. It's only code improvements & a super minor bug fix, I'm not dependent on it.
19:00mstenta[m]Cool! Thanks :-)
19:02mstenta[m]this is going to be a pretty big release! 20+ changelog entries! :-)
19:51*polo__ has quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
20:37*Guest5055 has joined
20:39mstenta[m]paul121: I'm just giving this some thought... www.drupal.org/project/farm/issues/33112
20:39mstenta[m]Just realized: we define the `client_id` fields as a *bundle* field, not a base field
20:39mstenta[m]> I was able to add this as a _Bundle field_ (instead of a Base field) using `hook_entity_base_field_info()`. This puts the new field in its own DB table, just as the field storage definitions do for the consumer fields mentioned above.
20:40mstenta[m]www.drupal.org/node/3207716
20:41mstenta[m]I wonder if that will actually make the transition any easier... considering that Consumers will be adding it as a base field, which will add it to the `consumers_field_data` table, rather than to a separate table like we are doing
20:41mstenta[m]Need to think through how all the update hooks will interact... 🤔
20:43paul121[m]what do you mean, we actually thought ahead about this? 1.5 years ago and forgot?? 😁
20:43paul121[m]I did not notice it was in a bundle field
20:44mstenta[m]hahaha
20:44mstenta[m]well it might be a happy accident
20:44paul121[m]well a base and bundle field with the same name is no bueno
20:44mstenta[m]yes. we're not out of the fire yet.
20:45mstenta[m]api.drupal.org/api/drupal/core%21lib%21D
20:45mstenta[m]but we might be able to swing it...
20:45paul121[m]can we run hooks in a specific order? alter the order?
20:45mstenta[m]`hook_update_depenencies()` lets you define which `hook_update_N()` needs to run first
20:45mstenta[m]so we can add ours before the Consumers
20:45mstenta[m]thinking through what that will need to do now...
20:46paul121[m]oh wow. that seems perfect
20:46mstenta[m]save the existing `client_id` values somewhere (maybe just a temporary state variable?)...
20:46mstenta[m]uninstall the existing field...
20:46mstenta[m]then let the consumer update hook(s) run (there are two of them)
20:46mstenta[m]then run another update hook of our own to copy the `client_id` values back
20:46mstenta[m]maybe?
20:47paul121[m]Seems logical
20:47mstenta[m]> maybe just a temporary state variable?
20:47mstenta[m]i don't think there are ever more than a handful, if that... so this should work I think?
20:47paul121[m]yeah
20:47mstenta[m]might sketch up a wip commit quick to think it through...
20:47paul121[m]or, we could rename our field so it doesn't conflict as step 1, and then after consumers is updated copy the values over & finally remove our field
20:48paul121[m]that seems a bit more challenging tho
20:48mstenta[m]yea thought about that too... it's more work
20:48mstenta[m]yea
20:48mstenta[m]renaming a field basically means creating a new one, migrating to it, deleting the old one
20:48mstenta[m]might not be necessary
21:00*Guest5055 has quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
21:00mstenta[m]yea i think this should work... in theory
21:02mstenta[m]draft commit: github.com/mstenta/farmOS/commit/bd4d8bb
21:02mstenta[m](still needs the actual logic, but scaffolds the hooks and comments...)
21:17paul121[m]makes sense!
21:17mstenta[m]sketching up the actual logic right now... pretty simple (if it works - we'll have to see)
21:20paul121[m]making another PR... simple but not urgent ;-)
21:22mstenta[m]paul121: commit w/ logic -> github.com/mstenta/farmOS/commit/65d5820
21:22mstenta[m](100% untested)
21:23paul121[m]so with the update hook dependencies... say we merged these changes in now, before the consume module has a release with the update hook
21:23paul121[m]with the farm_api update hooks not be attempted until a relevant consumers release is included?
21:23mstenta[m]oh hmmmmm
21:23paul121[m]s/with/will/, s/farm_api/farm\_api/
21:23mstenta[m]that's a really good question
21:24mstenta[m]let me see what happens when i run `drush updb` locally!
21:28*polo___ has joined
21:28mstenta[m]hmm, I don't think it worked as expected... it just ran the updates
21:30mstenta[m](and revealed a bug in my code) 😅
21:41mstenta[m]Hmm need to figure out the right way to uninstall the field definition
21:41mstenta[m]This is NOT it:... (full message at <libera.ems.host/_matrix/media/r0/downloa>)
21:41mstenta[m]`FieldStorageConfig::loadByName('consumer', 'client_id')` is `null`
21:41mstenta[m]because it's not a config field :-)
21:42paul121[m]:-/
21:44mstenta[m]looks like `entity` module might have the logic we need...
21:44mstenta[m]in `BundlePluginInstaller::uninstallBundles()`
21:45mstenta[m]to be continued... dinner time :-)
22:12*polo___ has quit (Changing host)
22:12*polo___ has joined
22:12*polo___ is now known as polo___
22:12*GiverOfDomains is now known as GiverOfDomains

< 262022-09-27⋏28 >