Hello o/
I found this while testing migrating my account from the reference PDS to tranquil v0.6.6-31-g3ade3d1
Tranquil currently parses personalDetailsPref.birthDate as %Y-%m-%d. Its tests also use date-only values. Afaict, this is incorrect.
birthDate uses the datetime format and the ATProto datetime spec requires a full timestamp with timezone information. The @atproto/api client serializes JS dates with toISOString(), producing values like 2000-01-01T00:00:00.000Z. The reference PDS reads that timestamp and generates declaredAgePref.
So declaredAgePref is lost after migrating:
- Original PDS has
personalDetailsPref.birthDateand generateddeclaredAgePref - Tranquil's
putPreferencesstorespersonalDetailsPref - It discards the submitted
declaredAgePrefbecause it's read-only getPreferencescan't parse the timestamp frompersonalDetailsPref.birthDate- So it doesn't generate its own
declaredAgePref
You should be able to reproduce by setting this from a full-access session
{
"$type": "app.bsky.actor.defs#personalDetailsPref",
"birthDate": "2000-01-01T00:00:00.000Z"
}
Then calling getPreferences to see whether it returns birthDate and a generated declaredAgePref, or only birthDate.
I'm very new to the Atmosphere and happy to be told I've utterly misunderstood things! If it sounds right, I've got a fix I can open a PR for whenever 😃
I finished migrating to a version of tranquil with this patch applied and it's working as expected so far!