Skip to content

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

Closed

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

  1. Adron commented on Sep 16, 2026

    @Adron
    MemberAuthor

    Implemented in #94. Closing here — further work tracks in the PR.

    One acceptance criterion is only partly met, deliberately. "A newly posted message with a link shows its preview in the feed without a manual refresh" — the POST now fires, but the preview lands on the next feed fetch rather than immediately. The feed row renders message.linkMetadata?.links ([LinkMetadataItem]) while refreshMessageMetadata returns [MessageLinkPreview], a different shape. Folding the response straight back into the locally-inserted feed message would need an AppDataStore mutation plus a shape conversion — past the scope of this wiring, and the web behaves the same way. Split out as #96.

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