#dev 2020-09-09

2020-09-09 UTC
[jgmac1106], jonnybarnes, jeremy, chatterley, geoffo and gxt__ joined the channel
#
GWG
mp- properties in Micropub should not be returned in q=source, correct?
#
aaronpk
yes because they do not get stored as properties because they are commands
#
GWG
The old Micropub code was storing everything. Trying to update it.
shoesNsocks1 and joshghent joined the channel
#
GWG
I am trying to adapt the WordPress Micropub plugin to stop storing published as a property and instead use the WordPress stored properties.
#
GWG
The problem is timezone offset.
#
aaronpk
timezone offsets are always a problem :)
#
GWG
WordPress doesn't store an offset in its database
#
GWG
So the returned timezone is defaulting to the site timezone.
#
GWG
Which means the unit test is failing
#
aaronpk
you could store the timezone in a custom property maybe?
#
GWG
I'm trying to figure out if there is a case for returning the published/updated properties with the original offset
#
GWG
Or if it doesn't matter
#
aaronpk
it's nitpicky but probably doesn't matter
#
GWG
aaronpk: I do in my location plugin, so that isn't an issue
#
GWG
I'm just trying to think of a use case
#
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
#
aaronpk
but it matters more when i'm traveling a lot
#
GWG
aaronpk: I do it elsewhere, but I suppose I can do it here.
#
GWG
I just never liked the fact it was stored twice.
[chrisaldrich] joined the channel
#
Ruxton
GWG: what do u mean WordPress doesnt store the offset in the DB? there's two options for it in wp_options?.
#
GWG
Ruxton: Not on a per post level
#
GWG
Which is why my unit tests now fail.
#
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 :/
#
GWG
Ruxton: That's what I'm thinking.
#
GWG
All this because I didn't want to break compatibility
#
Ruxton
I accepted YEARS ago, my site operates in a timezone that is very possibly independent from my current timezone
#
GWG
Ruxton: I wrote a lot of code to do that.
#
GWG
Now I need to add some to Micropub.
#
Ruxton
so it could be independent?
#
Ruxton
so many headaches to side step O_O
#
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
#
Ruxton
and they never will, so maybe it's has to fail?
#
Ruxton
hating on unit tests ;P
#
GWG
Well, Micropub is the most unit tested of the projects I work on. snarfed saw to that.
j605 joined the channel
#
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
#
Loqi
GWG has 28 karma in this channel over the last year (140 in all channels)
#
GWG
Well, input should match output.
#
GWG
So, storing the timezone makes sense.
#
GWG
Allowing me to stop storing published and updated time.
#
GWG
As already stored.
cjw6k_, jonnybarnes and nickodd joined the channel
#
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
#
GWG
How can I test that?
#
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
#
[snarfed]
pick a threshold, eg 5s, and test that abs(published - current) is within that
#
[snarfed]
yup aaronpk++ jinx
#
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"
#
Ruxton
giving it a tolerance makes it prone to random failures depending on the load/available processing power of the test runner
#
Ruxton
eg. it passes on your machine, but fails on another
#
Ruxton
or it passes on your machine, but when you're compiling something and test running it fails
#
GWG
That works, if I mock it in, I suppose.
[jeremycherfas] and KartikPrabhu joined the channel
#
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
#
@vladfaust
I'm willing to turn my website into an aggregate feed of my Telegram, Twitter, Instagram, GitHub etc. posts and activity, as well as full-fledged articles. All supporting webmentions!
(twitter.com/_/status/1303698459216801792)
[James_Gallaghe], KartikPrabhu, [chrisaldrich], [jgmac1106], nickodd, [Chaitanya], [Rose] and [tb] joined the channel
#
[tb]
Finally fixed that redirect bug in the indieauth_discovery gem
#
@RubygemsN
indieauth_discovery (0.1.1): Profile and client discovery for IndieAuth clients and providers https://rubygems.org/gems/indieauth_discovery
(twitter.com/_/status/1303738173227491330)
KartikPrabhu joined the channel
#
GWG
Trying to figure out, while I'm in the Micropub plugin fixing things, what other experimental stuff I could add
#
GWG
Anyone have any extension ideas that might be easy?
KartikPrabhu joined the channel
#
[chrisaldrich]
support for Featured photos?
#
[chrisaldrich]
not sure how easy/hard that might be, but may fit in line with your post kinds deduplication work....
#
[chrisaldrich]
It was one of the first things someone thought of this morning on trying out micropub specifically for photos: https://twitter.com/topher1kenobe/status/1303723025313996801
#
@topher1kenobe
@ChrisAldrich @elibud @daljo628 @helenhousandi I just tried it, and it lacks title, categories, and Feature Image.
(twitter.com/_/status/1303723025313996801)
#
GWG
Note to self, test categories
#
Loqi
[dshanske] #239 Tags and Categories
gRegorLove, [jeremycherfas] and [schmarty] joined the channel; nickodd left the channel
#
[chrisaldrich]
oops, realized this wasn't wordpress and you were looking for something else David.
#
GWG
Yes, feel free to continue the specific WordPress part in the WordPress chat
#
[chrisaldrich]
Maybe add polling for tags/categories to Quill? 😉
#
GWG
I was thinking generally
#
[chrisaldrich]
I think Indigenous is the only client I've seen that does that....
jonnybarnes and [James_Gallaghe] joined the channel
#
GWG
[chrisaldrich]: ++ for swentel
#
Loqi
[chrisaldrich] has 12 karma in this channel over the last year (67 in all channels)
jonnybarnes, [schmarty] and geoffo joined the channel