Fix actor settings data model #183

Closed
opened 2026-06-21 18:29:07 -05:00 by erik · 3 comments
Owner

Summary

Actor profile settings were improved in the web UI, but the underlying data model still stores known actor profile fields as serialized JSON text in activitypub_actors.profile_metadata_json, and activitypub_settings is a misleading singleton pointer table rather than real settings.

Steps to reproduce

  1. Configure actor profile fields in /settings/actor, including avatar, banner, website, pronouns, or location.
  2. Inspect the dev SQLite database.
  3. Query activitypub_actors and activitypub_settings.

Expected behavior

  • Known actor profile fields are stored in explicit schema fields, not an opaque JSON text blob.
  • The single website actor model is explicit, or any primary-actor selector table is accurately named and justified.
  • The schema reflects the current single-actor product behavior instead of unused future-proofing.

Actual behavior

  • activitypub_actors.profile_metadata_json stores known fields such as imageUrl, bannerUrl, and website as serialized JSON text.
  • activitypub_settings stores only id, primary_actor_id, and timestamps, acting as a singleton pointer while being named like a settings table.
  • The UI no longer exposes raw JSON, but storage still relies on raw JSON for supported actor fields.

Acceptance criteria

  • Known actor profile fields are migrated out of profile_metadata_json into explicit columns or another explicit normalized structure.
  • Actor read/write code no longer stores supported profile fields as serialized JSON text.
  • Existing actor data is migrated without data loss.
  • activitypub_settings is removed, renamed, or replaced with a clearly justified model.
  • Tests cover migration/read/write behavior for existing actor profile data.
  • The implementation follows existing project conventions.
## Summary Actor profile settings were improved in the web UI, but the underlying data model still stores known actor profile fields as serialized JSON text in `activitypub_actors.profile_metadata_json`, and `activitypub_settings` is a misleading singleton pointer table rather than real settings. ## Steps to reproduce 1. Configure actor profile fields in `/settings/actor`, including avatar, banner, website, pronouns, or location. 2. Inspect the dev SQLite database. 3. Query `activitypub_actors` and `activitypub_settings`. ## Expected behavior - Known actor profile fields are stored in explicit schema fields, not an opaque JSON text blob. - The single website actor model is explicit, or any primary-actor selector table is accurately named and justified. - The schema reflects the current single-actor product behavior instead of unused future-proofing. ## Actual behavior - `activitypub_actors.profile_metadata_json` stores known fields such as `imageUrl`, `bannerUrl`, and `website` as serialized JSON text. - `activitypub_settings` stores only `id`, `primary_actor_id`, and timestamps, acting as a singleton pointer while being named like a settings table. - The UI no longer exposes raw JSON, but storage still relies on raw JSON for supported actor fields. ## Acceptance criteria - [ ] Known actor profile fields are migrated out of `profile_metadata_json` into explicit columns or another explicit normalized structure. - [ ] Actor read/write code no longer stores supported profile fields as serialized JSON text. - [ ] Existing actor data is migrated without data loss. - [ ] `activitypub_settings` is removed, renamed, or replaced with a clearly justified model. - [ ] Tests cover migration/read/write behavior for existing actor profile data. - [ ] The implementation follows existing project conventions.
Author
Owner

Synced from todu comment by @todu on 2026-06-22T03:14:53.417Z

Review update

  • PR: #184 is open and CI passed.
  • Result: approved with no blocking issues or warnings.
  • Verified: local ./scripts/pre-pr.sh passed and Forgejo Actions task #251 passed for commit ea4034e.
  • Follow-up: waiting for explicit human merge approval.
_Synced from todu comment by @todu on 2026-06-22T03:14:53.417Z_ ### Review update - PR: #184 is open and CI passed. - Result: approved with no blocking issues or warnings. - Verified: local `./scripts/pre-pr.sh` passed and Forgejo Actions task #251 passed for commit `ea4034e`. - Follow-up: waiting for explicit human merge approval.
Author
Owner

Synced from todu comment by @todu on 2026-06-22T03:22:46.325Z

Review update

  • PR: #184 was amended to fix ActivityPub actor document publishing for local avatar/banner settings.
  • Result: approved with no blocking issues or warnings.
  • Verified: local ./scripts/pre-pr.sh passed and Forgejo Actions task #252 passed for commit c4f3655.
  • Follow-up: waiting for explicit human merge approval.
_Synced from todu comment by @todu on 2026-06-22T03:22:46.325Z_ ### Review update - PR: #184 was amended to fix ActivityPub actor document publishing for local avatar/banner settings. - Result: approved with no blocking issues or warnings. - Verified: local `./scripts/pre-pr.sh` passed and Forgejo Actions task #252 passed for commit `c4f3655`. - Follow-up: waiting for explicit human merge approval.
erik 2026-06-21 22:36:23 -05:00
Author
Owner

Synced from todu comment by @todu on 2026-06-22T03:36:01.017Z

Closing summary

Task is ready to close based on PR #184 merged to main (740be63, implementation commit c4f3655).

Acceptance criteria evidence:

  • Known profile fields moved from activitypub_actors.profile_metadata_json into structured activitypub_actor_settings columns via migration 023_activitypub_actor_settings_model.sql.
  • Actor create/update/read paths write and read structured columns in template/site/src/federation/actors.ts instead of storing supported fields as serialized JSON text.
  • Migration preserves existing actor identity, keys, timestamps, primary actor selection, and supported profile metadata fields.
  • activitypub_settings is replaced by explicit activitypub_primary_actor, with model documentation updated in docs/identity-model.md.
  • Migration and read/write behavior are covered by database, federation, route, and admin settings tests.
  • Review comment recorded local ./scripts/pre-pr.sh and Forgejo Actions passing before merge.

Result: READY; task closed.

_Synced from todu comment by @todu on 2026-06-22T03:36:01.017Z_ ### Closing summary Task is ready to close based on PR #184 merged to `main` (`740be63`, implementation commit `c4f3655`). Acceptance criteria evidence: - Known profile fields moved from `activitypub_actors.profile_metadata_json` into structured `activitypub_actor_settings` columns via migration `023_activitypub_actor_settings_model.sql`. - Actor create/update/read paths write and read structured columns in `template/site/src/federation/actors.ts` instead of storing supported fields as serialized JSON text. - Migration preserves existing actor identity, keys, timestamps, primary actor selection, and supported profile metadata fields. - `activitypub_settings` is replaced by explicit `activitypub_primary_actor`, with model documentation updated in `docs/identity-model.md`. - Migration and read/write behavior are covered by database, federation, route, and admin settings tests. - Review comment recorded local `./scripts/pre-pr.sh` and Forgejo Actions passing before merge. Result: READY; task closed.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
erik/slugkit#183
No description provided.