Skip to content

Prism import: keep member banners, and the system avatar and tag - #381

Merged
SiteRelEnby merged 3 commits into
mainfrom
fix/prism-import-system-images
Nov 9, 2026
Merged

SiteRelEnby merged 3 commits into
mainfrom
fix/prism-import-system-images

Conversation

@SiteRelEnby

Copy link
Copy Markdown
Contributor

From a report that banners were missing after a Prism import.

  • Member banners. A Prism headmate's header image is its banner. The importer grouped it with the font and layout fields as presentation and dropped it. It now becomes the member's banner through the same image pipeline, quota and caps as the avatar. The choice of image follows Prism's own header resolver: the PluralKit banner when the headmate asked for it and is linked to PluralKit (cached bytes first, else the cached CDN URL, else the original URL, with external links policy-gated the way the PluralKit avatar fallback already is), Prism's own image otherwise, and nothing for a header the headmate has hidden. Counted as banners_imported in the job report.
  • System avatar and tag. The Prism system block carries systemAvatarData and systemTag; both were ignored. They are now filled in when the Sheaf system has none yet, the same only-empty-fields rule the name, description and colour follow. Prism has no system banner, so there is nothing to carry there.
  • PluralPort path. Already correct for system and member banners (a Prism PluralPort export maps the header image to banner_asset_id). A test now pins the system avatar and banner restoring from a bundle, which had no coverage.

The Prism import notes in the design docs are corrected to match.

Verification

  • Prism runner: a header image lands as the member banner alongside the avatar, counted separately; source rules (PluralKit asked for and linked, PluralKit asked for but not linked, hidden) produce the PluralKit bytes, Prism's own image, and nothing respectively; system avatar and tag fill empty fields and a second import does not overwrite them.
  • PluralPort runner: a bundle with a system avatar and banner restores both under fresh keys.
  • Prism runner, Prism caps, Prism field translation, PluralPort runner and Prism bridge suites pass against a rebuilt test stack. Ruff clean.

A Prism headmate's header image (`profileHeaderImageData`) is its
banner. The importer filed it with the font and layout settings around
it as presentation and dropped it, so members came across without
their banners. It now lands on `banner_url` through the same image
pipeline, quota and caps as the avatar. Which image is the banner
follows Prism's own resolver: the PluralKit banner when the headmate
asked for it and is linked to PluralKit (cached bytes, else the cached
CDN URL, else the original URL, external links policy-gated as the
avatar fallback is), Prism's own image otherwise, and nothing for a
header the headmate has hidden. The job report counts banners on their
own.

The system block's `systemAvatarData` and `systemTag` are taken too,
onto empty fields only, the way the name, description and colour
already were. Prism has no system banner.

The PluralPort path already carried system and member banners; a test
now pins the system avatar and banner restoring from a bundle.
@SiteRelEnby
SiteRelEnby enabled auto-merge November 8, 2026 19:22
`_apply_system_profile` is called directly by the internal-image-ref
unit tests with its three-argument signature, and had grown an async
signature with a database session so it could store the system avatar.
It is synchronous again and hands the avatar base64 back instead;
`run_import` runs it through the image pipeline. Same behaviour, and
the helper stays testable without a stack.
@SiteRelEnby
SiteRelEnby merged commit ad5320c into main Nov 9, 2026
24 checks passed
@SiteRelEnby
SiteRelEnby deleted the fix/prism-import-system-images branch November 9, 2026 03:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant