Provinite / Provinite/chardb

og:description falls back to the site blurb for a character with no details, species or owner

Open Beginner friendly
#367 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
0
Forks
0
Avg merge
2h 52m
Merged PRs (30d)
85

Description

A character with no details, no species and no owner gets the generic site blurb as its og:description and meta description, rather than anything about the character.

Where

apps/frontend/src/pages/CharacterPage.tsx builds the description as:

description:
  character?.details ||
  [
    character?.species?.name,
    character?.owner ? `owned by ${character.owner.username}` : null,
  ]
    .filter(Boolean)
    .join(" · "),

With all three absent the array is empty, join returns "", and applyPageMeta (src/lib/pageMeta.ts) treats empty as absent:

const description = meta.description ? truncate(meta.description) : DEFAULT_DESCRIPTION;

so the page describes itself as "A home for original characters: profiles, art galleries, species and the communities built around them."

Why it happens

All three inputs are genuinely optional. speciesId and ownerId are both nullable on the Character model — a character kicked from its species, or one whose owner was deleted (onDelete: SetNull), reaches this state, and details is free text nobody has to fill in. The codebase already models ownerless characters as "orphaned" throughout, so this isn't a hypothetical.

Impact

Low. The title is still correct — the character's name — so the card and the tab are not wrong, just uninformative in the second line. Affects the meta description Google indexes and, once server-side rendering exists, the unfurl.

Fix sketch

Give the character page its own last-resort description rather than falling through to the site's, e.g. "A character on CharDB". The reverted backend renderer did exactly that; the client-side path was never given the equivalent.

Worth deciding at the same time whether applyPageMeta's empty-string-means-absent behaviour is right in general, or whether callers should pass null explicitly when they mean "no description".

Follow-up from #365. Third of three copy issues noted at merge; this is the second.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in apps/frontend/src/pages/CharacterPage.tsx and trace how its description reaches applyPageMeta in src/lib/pageMeta.ts. Check the empty-details, missing-species, and missing-owner case, then verify that it receives a character-specific fallback while existing details, species, and owner descriptions remain unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
74/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.