💾 Archived View for satch.xyz › skylab › metadata.gmi captured on 2024-03-21 at 15:15:43. Gemini links have been rewritten to link to archived content

View Raw

More Information

-=-=-=-=-=-=-

Notes on the Misfin(C) Metadata format

Why we chose to use empty lines for the absence of metadata

Our motivator to change the metadata format from the Misfin(B) format was to make it not extensible. We also wanted to avoid the appearance that Misfin uses extended gemtext.

Formats written in JSON are extensible because there are labels for everything. If you want to add a new value, you add a new label, easy. The new field in the JSON file is not read by some programs but is read by others.

So with misfin, if we remove the linetypes, or the *labels*, aka. "<", ":", and "@", then you cannot add labels to the metadata that are read by some programs and not read by others. And to do that, we have to put every data type on the same line depending on its type. So the first line is for senders, the second line is for recipients, and the third is for timestamps.

If we limit the number of lines to 3 lines, then any extra metadata that someone tries to squeeze in will be parsed as part of the message body.

We have 3 lines, each for the 3 data types, with no labels. This is much like a binary format where 3 fields are delimited by the newline ASCII code (0x0A).

But now, what if a line was empty? For example, what if there were no recipients data? If we remove the line, then the program has no way of identifying what is recipients and what is timestamps. That's the feature/downside of no labels.

What this means for message storage and parsers

Not much! This metadata format is only specced over the wire. When you store messages, you can store metadata however you like! You can use labels, even add axtra metadata using your own labels. You are free from the specification.

When you send a message that has been stored, you will need to parse your message into some kind of Message class which holds the information of the message so that you can create a spec-conforment string to send over the wire. This should be pretty easy! Something like this:

senders_metadata + \n + recipients_metadata + \n + timestamps + \n + message_body

If there is no senders metadata, there will be an empty string before the newline.