Skip to content

W8: Refresh link-preview metadata after publishing a message #91

Description

@Adron

Split out of #64 (see PR #90). APIClient.refreshMessageMetadata(messageId:) is implemented and
tested but has no caller; #64 kept it rather than deleting it because there is a real use, but
wiring it changes the publish path and deserved its own change.

What the web does

POST /api/messages/{id}/metadata fetches OpenGraph metadata for a message's links. The web fires
it after publishing (components/messages/MessageInput.tsx:511) and again after an edit,
fire-and-forget with a swallowed failure, so a new post's link previews populate without a reload.

iOS today

ComposeView renders a live preview while composing, but nothing refreshes metadata on the server
after the message is created — so the link preview can be missing on the feed until something else
populates it.

Build this

Acceptance criteria

  • A newly posted message with a link shows its preview in the feed without a manual refresh.
  • A message with no links issues no request.
  • A failure is invisible to the user and the post still succeeds.
  • Unit test for the "no links ⇒ no request" guard.

Files: Views/ComposeView.swift, Services/APIClient.swift:370.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestws:papercutsW8 — small parity papercuts

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions