2020-09-09 UTC
[jgmac1106], jonnybarnes, jeremy, chatterley, geoffo and gxt__ joined the channel
# 01:59 GWG mp- properties in Micropub should not be returned in q=source, correct?
# 02:00 aaronpk yes because they do not get stored as properties because they are commands
# 02:00 GWG The old Micropub code was storing everything. Trying to update it.
shoesNsocks1 and joshghent joined the channel
# 03:23 GWG I am trying to adapt the WordPress Micropub plugin to stop storing published as a property and instead use the WordPress stored properties.
# 03:23 GWG WordPress doesn't store an offset in its database
# 03:23 GWG So the returned timezone is defaulting to the site timezone.
# 03:24 GWG Which means the unit test is failing
# 03:24 aaronpk you could store the timezone in a custom property maybe?
# 03:24 GWG I'm trying to figure out if there is a case for returning the published/updated properties with the original offset
# 03:24 GWG aaronpk: I do in my location plugin, so that isn't an issue
# 03:24 GWG I'm just trying to think of a use case
# 03:24 aaronpk i like it because it means my posts show the local time of wherever i was when i posted, rather than an arbitrary timezone
# 03:26 GWG aaronpk: I do it elsewhere, but I suppose I can do it here.
# 03:26 GWG I just never liked the fact it was stored twice.
[chrisaldrich] joined the channel
# 03:43 Ruxton GWG: what do u mean WordPress doesnt store the offset in the DB? there's two options for it in wp_options?.
# 03:43 GWG Which is why my unit tests now fail.
# 03:48 Ruxton ahh yeah, so much stank around from pre-timezone support, the only ability you really have per post is a timezone string which can't display zones :/
# 03:49 GWG Ruxton: That's what I'm thinking.
# 03:49 GWG All this because I didn't want to break compatibility
# 03:49 Ruxton I accepted YEARS ago, my site operates in a timezone that is very possibly independent from my current timezone
# 03:50 GWG Ruxton: I wrote a lot of code to do that.
# 03:50 GWG Now I need to add some to Micropub.
# 03:52 GWG It's storing published and updated properties in post meta. Duplicating built-in elements. I fixed that, then the unit tests failed as the offsets didn't match
# 03:52 Ruxton and they never will, so maybe it's has to fail?
# 03:56 GWG Well, Micropub is the most unit tested of the projects I work on. snarfed saw to that.
j605 joined the channel
# 04:01 Ruxton yeah but sounds liike you're trying to fix a test that invariably you want to fail, why do they need to match from a "wordpress is working AOK" point of view?
[snarfed] joined the channel
# 04:01 Loqi GWG has 28 karma in this channel over the last year (140 in all channels)
# 04:04 GWG So, storing the timezone makes sense.
# 04:04 GWG Allowing me to stop storing published and updated time.
cjw6k_, jonnybarnes and nickodd joined the channel
# 04:53 GWG Now I have a problem. The current time, which I'm comparing to the published time, is a second off, so causing the comparison to fail.
joshghent joined the channel
# 04:57 aaronpk either give the test a tolerance of a few seconds, or don't compare against the current time, compare against the time the test started
# 04:57 [snarfed] pick a threshold, eg 5s, and test that abs(published - current) is within that
# 05:09 Ruxton the best way to fix that is override current time requests in your test to return a static/freezeable value. In Rails this was called "Time Freezing" "Time Travelling" and the gem for it was "timecop"
# 05:10 Ruxton giving it a tolerance makes it prone to random failures depending on the load/available processing power of the test runner
# 05:10 Ruxton eg. it passes on your machine, but fails on another
# 05:10 Ruxton or it passes on your machine, but when you're compiling something and test running it fails
# 05:11 GWG That works, if I mock it in, I suppose.
[jeremycherfas] and KartikPrabhu joined the channel
# 05:51 gRegorLove not sure if you need something like this, but cakephp has a lib, Chronos, that does frozen times
jonnybarnes, KartikPrabhu, swentel, [frank], dckc, moppy, jeremy, jeremy-, gRegorLove, [James_Gallaghe], [tantek], shoesNsocks, [Chaitanya] and geoffo joined the channel
[James_Gallaghe], KartikPrabhu, [chrisaldrich], [jgmac1106], nickodd, [Chaitanya], [Rose] and [tb] joined the channel
# 16:53 [tb] Finally fixed that redirect bug in the indieauth_discovery gem
KartikPrabhu joined the channel
# 17:34 GWG Trying to figure out, while I'm in the Micropub plugin fixing things, what other experimental stuff I could add
# 17:35 GWG Anyone have any extension ideas that might be easy?
KartikPrabhu joined the channel
# 18:20 [chrisaldrich] not sure how easy/hard that might be, but may fit in line with your post kinds deduplication work....
gRegorLove, [jeremycherfas] and [schmarty] joined the channel; nickodd left the channel
# 19:14 [chrisaldrich] oops, realized this wasn't wordpress and you were looking for something else David.
# 19:14 GWG Yes, feel free to continue the specific WordPress part in the WordPress chat
jonnybarnes and [James_Gallaghe] joined the channel
# 19:53 Loqi [chrisaldrich] has 12 karma in this channel over the last year (67 in all channels)
jonnybarnes, [schmarty] and geoffo joined the channel