#dev 2026-06-02

2026-06-02 UTC
kenichimiyake, dabeglavins, cotsuka, ax562, dabeglavins5, grufwub, NaomiAmethyst, aaronpk, [jeremycherfas] and calciume joined the channel
#
[capjamesg]
Does anyone know why a Sqlite3 database would be slow on running a query for the first time, but quicker on subsequent runs?
#
[capjamesg]
I have set up indexes for my query but the first run is slow.
#
[capjamesg]
I have been trying to figure this out for weeks but have had no luck 🤦
blacklight joined the channel
#
[pcarrier]
Page cache
#
[pcarrier]
Try mlocking the whole file in eg pcma to confirm
#
[capjamesg]
The database file?
#
[capjamesg]
Are there any side effects of mlocking it?
cotsuka joined the channel
#
[pcarrier]
yes. sure, forces it to be in RAM at all times
#
[pcarrier]
so your kernel doesn't get to prioritize other stuff over that memory region
#
[pcarrier]
but I wrote pcma because well, sometimes, it just makes sense (it was for in-memory DB servers at spotify)
#
[pcarrier]
at least confirm that's what the slowness is from. you can empty the page cache with /proc/sys/vm/drop_caches and/or force it to stay there with pcma or equivalent
#
[pcarrier]
but "slow the first time, fast shortly after" is pretty much tell tale
#
[capjamesg]
Sounds good! I will try this. [pcarrier]++
#
Loqi
[pcarrier] has 2 karma in this channel over the last year (8 in all channels)
#
[capjamesg]
Wait if it puts the whole DB in memory that will not work. The file is ~20 GB right now and I only have 8 GB of RAM on the server.
#
[pcarrier]
yup, not an option
#
[pcarrier]
at the very least you can confirm dropping the cache reliably brings you back to the perf of the first query
#
[pcarrier]
and of course to speed that one up, you'll want either faster storage, or a warmup
#
[pcarrier]
but if it has to read a bunch from (relatively) slow storage, not much else you can do I'm afraid
lavandula joined the channel
#
[capjamesg]
I am using a mounted Hetzner Volume right now for storage.
calciume joined the channel
#
[KevinMarks]
Also the first query will usually read the indexes into RAM, so subsequent ones will not hit the disc for those, and if you're joining smaller tables they may end up, cached in RAM too.
#
[KevinMarks]
When the indexes no longer fit in RAM you see another order of magnitude slow down
#
[capjamesg]
Interesting.
#
[capjamesg]
There is about a 10x difference between first and second runs.
#
[capjamesg]
~1s -> ~10s
duanin2, ZodiacalComet, oxtyped, cotsuka, barnaby, jorisvandijk, blacklight, deathcomestotime and lwindolf joined the channel; brn left the channel
#
lwindolf
Hello! I'm currently trying to decide whether to add microsub support to GTK feed reader liferea. Technically (aside from the need to support OIDC) it seems easy. I worried though that the microsub spec is still a draft with man open issues in Github. What to expect there?
gmb_ joined the channel
#
aaronpk
the core part of microsub is stable, but there's definitely a lot of parts of it that can be improved. we really need more people interested in building it to make progress, so your experience would be helpful
#
lwindolf
One thing I noted from a desktop perspective is that drag&drop of feeds between folders is usually a part of functionality which is for now missing in microsub. But it is easy to prevent.
#
aaronpk
hm there isn't the concept of folers in microsub yet, but you could approximate it in a client with a naming convention of using slashes in the names, then update would work https://indieweb.org/Microsub-spec#Update_a_Channel
cotsuka, btrem and blacklight joined the channel
#
jak2k
Are there plans to simplify micropub? It's quite hard to implement because both forms and JSON has to be supported and because there is no clear differentiation between posts, articles, bookmarks, etc. It all depends on guessing based on which properties there are.
#
jak2k
*have to be supported
#
aaronpk
lack of post type is a feature not a bug
#
aaronpk
what is post type?
#
Loqi
A post or posts may refer to individual pieces of content published on an indieweb site such as notes, articles, responses, or the act of creating the aforementioned content (present tense), or Posts about the IndieWeb https://indieweb.org/post_type
#
aaronpk
what is post type discovery?
#
Loqi
Post Type Discovery specifies an algorithm for consuming code to determine the type of a post by its content properties and their values rather than an explicit “post type” property, thus better matched to modern post creation UIs that allow combining text, media, etc in a variety of ways without burdening users with any notion of what kind of post they are creating https://indieweb.org/Post_Type_Discovery
#
aaronpk
do we not have a page that talks about the reasons to not have explicit post types in a CMS?
Sk joined the channel
#
[artlung]
Maybe that?
#
jak2k
micropublish expose it as different post types anyway…
#
jak2k
I get the reasoning. On my website, I don't want to mix articles, posts, bookmarks & so on and want to use totally different templates. This means I would have to filter in each database query (which is more expensive than I'd wish) or I would have to normalize into my data model before storing. But that would throw away some data and would make the endpoint logic even more complex. And clients such as
#
aaronpk
i also have separate feeds on my site for different posts based on their content, i did it by having an explicit link from a post into which places it appears in the site
#
jak2k
So you manually enter the posts URL to tell it in which feed to appear?
#
aaronpk
i have logic in my micropub endpoint that determines which feeds it should go into based on the properties in the post
#
aaronpk
then it writes that into an array in the yaml header
#
[tantek]
jak2k, keeping post types out of micropub makes micropub a simpler more minimal spec. that's by design. for folks that want to distinguish post types, the PTD spec provides that functionality, and then you can store the output of that in your database as necessary for your use-case(s)
#
aaronpk
oh yeah that is a better answer than what i was trying to describe
#
[tantek]
IMO feed types is orthogonal to that
#
aaronpk
basically run the PTD algorithm on the micropub request input and use that to store the type on your side
#
[tantek]
you might want feeds of only certain hashtags for example, however that mix say photos and notes
#
jak2k
Maybe, I should completely rethink how I organize my different sections and filter & cache instead of categorizing…
#
jak2k
That would be a completely different mental model but I see the appeal.
#
[tantek]
or you might want a feed of @-mentions for example, again, regardless of post type
#
jak2k
Are there cases where multiple titles, contents, … make sense?
[Sophia_wood] and rossabaker joined the channel
#
[snarfed]
we should have a "why is every property multiply valued?" mf2 faq
#
Loqi
it is probable
[Sophia_wood] and [fnhipster] joined the channel
#
[tantek]
thought we already had one?
#
[tantek]
jak2k yes, nearly every property has use-cases for multiple values, so to simplify the parsing and format models, every property is multi-valued
cotsuka joined the channel
#
[tantek]
that way parsing doesn't have to know anything about specific properties
#
jak2k
And another question: Is support for form encoding still that relevant today? (Except for compatibility purposes.)
#
aaronpk
it does mean you can write very simple micropub clients that use actual html forms
#
aaronpk
i don't think HTML ever specified json encoding for HTML forms, looks like this never went anywhere https://www.w3.org/TR/html-json-forms/
#
jak2k
How would IndieAuth even work with such clients?
#
aaronpk
the client would need to put the access token in a hidden form field, which is kinda not great but is possible
#
[tantek]
I believe folks have even implemented it!
#
[tantek]
(more than possible, was done)
#
jak2k
And how would that token get into the hidden field? Don't you need some kind of JS logic or backend logic for that?
#
aaronpk
i didn't say static website
#
aaronpk
pretty sure quill used to work that way until i started adding more features to the posting interface like geocoding and uploading photos, then i made it submit via javascript instead
ax562 joined the channel
#
jak2k
I totally get it as SHOULD. But if it already has backend logic that handles JSON to get the token, does that really justify a MUST? Can't that backend do a tiny bit of conversion too?
cotsuka and barnaby joined the channel
#
ZodiacalComet
I also thought of using a hidden field for my own micropub server/client, even considered allowing using a logged-in session for auth. But I pivoted into trying to make a social reader while I consider what to do.
#
ZodiacalComet
There was also the problem that I tried to place everything into a single server, which I'm starting to rethink
#
jak2k
ZodiacalComet: Yes, I'm also building it as multiple services this time. I just deployed my WIP IndieAuth implementation. What language do you use?
#
ZodiacalComet
As much as I wanted to use Rust, I cannot handle the compile times. So I'm using Python
#
ZodiacalComet
And that thing is that I'm thinking of doing too. A single server that only does authentication and everything else delegates to it. Granted, it's more to have in my LAN instead of having it into the open internet.
#
jak2k
I actually use Rust. The compile times can definitely be a pain point although splitting into services and playing with the build profile really helps.
#
jak2k
But if it's only in your LAN, it's not IndieAuth, right?
#
ZodiacalComet
Right, might be stretching it too much there on my part. It just does the auth dance that I read on the spec
blacklight joined the channel
#
[snarfed]
[tantek] re mf2 multiply valued faq, maybe? not on that page afaict, or on https://microformats.org/wiki/microformats2-parsing-faq . https://microformats.org/wiki/microformats2#microformats2_design is the closest I've found so far, but it's not great. "potentially" should probably be removed, and it's very terse and doesn't explain _why_
#
[tantek]
Good catch [snarfed]. I can see how the meaning of "potential" there could be ambiguous. I have amended it for clarity to "multivalue-capable". See update: https://microformats.org/wiki/microformats2#microformats2_design
#
[snarfed]
thanks! at the risk of nitpicking, "multivalue-capable" is...maybe better, but not the most obvious term. personally I might just use "multiply valued." not a big deal though, up to you
cotsuka joined the channel
#
[tantek]
I see what you're saying, however I think the ambiguous pronunciation (thus reading) of "multiply" is a downsite
#
[tantek]
downside*
#
[tantek]
like "multiply values" sounds like x * y 🙂
#
[snarfed]
valued with a d
#
[tantek]
always here for the nitpicking 🙂
#
[snarfed]
or "list-valued" or "array-valued"
#
[tantek]
yes I get the "valued" point being it's too close to the arithmetic operation
#
[snarfed]
"multiply-valued"
#
[tantek]
still can't help read that as "multiply" * operator and then reads werid
#
[snarfed]
alternatively, if we add a sentence or two explaining why, maybe this specific phrase is less important
#
[tantek]
I think the explanation is elsewhere, since this was a big point of discussion. Need to keep digging in the wiki to find it
#
[snarfed]
it's definitely a FAQ!
cotsuka joined the channel
#
gRegor
I read it as multiplication at first too
[Leo] joined the channel
[Leo] joined the channel
#
aaronpk
maybe we need to change the spelling... miltipley
#
aaronpk
multipley valued
#
gRegor
multiple-ish
#
ZodiacalComet
thought of "multivariable," but that also is weird
#
aaronpk
wait isn't it just "multi-valued"
#
ZodiacalComet
sounds better
#
[tantek]
multiverse
btrem joined the channel
#
jak2k
Mhh, there is an open issue for micropub.rocks regarding PKCE since June 2021… It seems to use `indieauth/client`. Maybe it just needs an upgrade of that dependency?
#
aaronpk
likely
rozodru joined the channel
#
btrem
I'm having trouble using node microformats-parser with 11ty. The problem is almost certainly with 11ty-fetch, I imagine with the cache, but I thought it would be worth asking here. Does anyone else use this combo?
#
btrem
Problem is that half the time, the parser successfully finds the `p-name` for me. And half the time, it says "not a string" OSLT.
cotsuka joined the channel
#
btrem
I just stopped and restarted the dev server. Here's the error: "Error: TypeError: Microformats parser: HTML is not a string"
#
ZodiacalComet
You are the one that asked to check for extracting the name before?
#
btrem
Yes indeed.
#
ZodiacalComet
Because I tried to debug it myself, but didn't say anything because I thought it would be a difference in version. For `Fetch` from `@11ty/eleventy-fetch` to return a string `{ type: "text" }` is required, otherwise it returns something else
#
ZodiacalComet
At least that is what I remember when I tried it, will check it again
#
btrem
I have `type: text` as one of my options.
#
ZodiacalComet
Ah, it returns a buffer. Gave up because I didn't want to check for how to convert it into a string
#
btrem
My options object is `const fetchOptions = { duration: "10m", returnType: "response", type: "text", verbose: true,}`
#
btrem
And then I do `eleventyFetch(data.url, fetchOptions).then((response) => {}`
#
ZodiacalComet
Okay, this is weird.
#
ZodiacalComet
The first time it returns an object. You need to use the attribute `body` on the result to get the response content
#
ZodiacalComet
It is a string when it is a cache miss, otherwise is a buffer of bytes
#
btrem
I don't follow your last point. When is it a cache miss? When my internet fails?
#
btrem
FWIW, I use `body` like so: `t = eleventyFetch(data.url, fetchOptions).then((response) => response.body).then((body) => mf2(body, { baseUrl: data.url,})).then((mf2json) => mf2json.items[0]?.properties?.name[0])`
#
[capjamesg]
aaronpk Can you take a look at the scopes that indielogin requires for auth? Someone at HWC Edinburgh this evening sent me this screenshot from their trying to log into the wiki with Codeberg via indielogin:
#
[capjamesg]
The “including private repos and organisations” part here feels inappropriate.
#
ZodiacalComet
btrem: the fetcher has a cache to store the responses it gets. So the next time you try to request the same page it uses that instead of hitting the page again. This is what happens when I do it twice on a clean cache https://i.ibb.co/Xf5KjqQB/mf2-test.png
#
aaronpk
why is the scope list blank tho?
#
[capjamesg]
I have no idea.
#
btrem
ZodiacalComet: Ok, that is unintuitive. To the point of being crazy. The object type changes if it gets it from the cache?!?!
#
btrem
I mean, isn't the point of the cache that you get the same thing, only from a local source?
#
ZodiacalComet
That is also why I didn't respond to you back then, thought it was just deno being different
#
aaronpk
i can't even find docs on codeberg's oauth
#
ZodiacalComet
btrem: Yeh, but something weird happens there. If you are able, throw in a `console.debug(body)` to check if it is a Buffer of bytes.
#
btrem
I either don't understand how it's supposed to work (admittedly, quite likely) or 11ty fetch is really bonkers. How am I to know which one I'm going to get? IOW, how do I know if it'll be the cache or from the web server?
#
[tantek]
capjamesg, aaronpk, I'm guessing codeberg changed their OAuth scopes and failed to support backcompat so it's falling back to an "all scopes" scope due to the now "unrecognized" scope
#
[tantek]
also why it would show up as blank, because they see an unrecognized scope and don't have a user display string for it in their new databse
cotsuka joined the channel
#
btrem
ZodiacalComet: I get `cache: hit` and `body: <Buffer....`, then the `TypeError` not a string.
#
btrem
...`TypeError` "...HTML is not a string".
#
ZodiacalComet
btrem: you can do something like `typeof body == 'string'` or the `response.cache` equals 'hit' (from cache) or 'miss' (fetched).
#
ZodiacalComet
Yeah, that is exactly what is happening on my side with deno
#
ZodiacalComet
The only thing if converting the buffer into a string which I didn't look into
#
aaronpk
wow i might want to just disable codeberg entirely
#
aaronpk
at least they don't have an xss but this is terrible
#
aaronpk
you can just type in whatever scopes you want and they echo it back
#
ZodiacalComet
aaronpk: it actually executed that?
#
aaronpk
those are real screenshots
#
aaronpk
does not give me a lot of confidence
#
btrem
aaronpk: Ok, that is also wild. More than 11ty-fetch even!
#
[capjamesg]
Oof what?
#
[capjamesg]
Is there a way to make it not request private repos?
#
[capjamesg]
It’s crazy that you can type in random scopes and it still says that.
#
jak2k
Forgejo (which Codeberg is using) doesn't support scopes yet. It's either no access or full access.
#
jak2k
The scope you send will be completely ignored.
#
[capjamesg]
jak2k++ for that piece of information.
#
Loqi
jak2k has 2 karma over the last year
#
[capjamesg]
But codeberg— for that.
#
aaronpk
that's crazy
#
aaronpk
wait, i see an issue about forgejo as an OIDC provider so theoretically this should be possible https://codeberg.org/forgejo/forgejo/issues/11430
#
aaronpk
but i don't see how to use that
#
aaronpk
but i don't even need an access token
#
jak2k
Yes, but access tokens already have scoping implemented. That's why these are mentioned in the title.
#
[tantek]
amazing that this stuff is still so hard like 10y+ after OAuth scopes were a thing. like why is this so hard? (we could say about various IndieWeb building blocks too 🙃 except OAuth was supposed to be "done" many years ago, and is at IETF which is held to a higher standard, as it were)
#
aaronpk
to be fair oauth was never supposed to be used for just login 😂
#
[tantek]
yes it absolutely was
#
[tantek]
Twitter's use of "sign-in with Twitter" was *exactly* that for 3rd party apps
#
[tantek]
that wanted to use Twitter for *identity* only
#
aaronpk
sign in != access data
#
[tantek]
not posting
#
[tantek]
or even reading
#
aaronpk
it _got_ used that way very quickly because obviously everyone wants to that
#
[tantek]
no, they, Twitter, specifically marketed Twitter for universal identity
#
[tantek]
I'm sure we have archived blog posts from 15y+ ago for this
#
aaronpk
that was the pre-IETF version of OAuth 1
#
[tantek]
pretty sure it was IETF version
#
[tantek]
1.1 at least
#
[tantek]
see also Facebook Connect
#
[tantek]
see also Google Sign-in (or whatever they called it)
#
aaronpk
facebook connect is what led to openid connect which is why it's called openid connect
#
[tantek]
they all enabled / encouraged OAuth for identity
#
gRegor
I just emailed Christian about the indieweb chat search error
cotsuka joined the channel
#
btrem
For others who land here, to convert from buffer to string in node, use this: `Buffer.from(response.body).toString();`
#
Loqi
btrem has 3 karma in this channel over the last year (5 in all channels)
[pcarrier], ax5623 and cotsuka joined the channel
#
btrem
Also, since I asked what algorithm I should use to get the title, I'll update what I've learned. Nothing new for veterans, but for someone just coming to it: my first thought was [[ if microformats.items == 1, return items[0]["p-name"]; if no p-name, return querySelector('h1').textContent; if no <h1>, return querySelector('head>title').textContent ]]
#
btrem
I wondered how reliable <h1>[0] would be. Turns out, not very. On my first test, I got the site name, and not the page/article title. So for now I'll skip the second part, and do `p-name` || head > title.
#
btrem
ZodiacalComet++ thanks for the tips about eleventy-fetch hit vs. miss. I'm now testing `response.cache` and then returning the string or the buffer converted to a string. It /seems/ to be working correctly now.
#
Loqi
ZodiacalComet has 1 karma in this channel over the last year (3 in all channels)