Skip to content

bug(web): shared issue and project links preview as Orbit branding and lose the ticket number #518

Closed

Description

@Ayaan2907

Problem

Sharing an issue or project link outside Orbit produces a preview for Orbit the
product, not for the thing that was linked. Apps that swap a pasted URL for the
page title make it worse. The URL and the ticket number disappear and the link
text becomes Orbit branding, so a reader can no longer tell which ticket was
shared.

Current: https://orbit.noveum.ai/issue/ENG-1 previews as "Orbit: the free,
realtime, keyboard-first task manager" with the marketing description and
/og.png. The page title a crawler sees is Sign in · Orbit.
Expected: the preview and the replaced link text keep the identifier, for
example ENG-1 · Orbit, and point at the URL that was shared.

Steps to reproduce

  1. Copy any issue URL from https://orbit.noveum.ai, for example /issue/ENG-1.
  2. Paste it into a chat or document that builds link previews.
  3. The card shows the Orbit landing title, description and image. Where the app
    replaces the URL with the page title, the ticket number is gone.

The same happens for /projects/<slug>. It does not depend on the issue or the
project existing.

Fetching the way a preview crawler does shows it without a chat app:

$ curl -s -o /dev/null -w '%{http_code}\n' -A 'Slackbot-LinkExpanding 1.0' \
    https://orbit.noveum.ai/issue/ENG-1
307        (location: /login)

$ curl -sL -A 'Slackbot-LinkExpanding 1.0' https://orbit.noveum.ai/issue/ENG-1
<title>Sign in · Orbit</title>
<meta property="og:title" content="Orbit: the free, realtime, keyboard-first task manager">
<meta property="og:description" content="Orbit is a free, realtime, keyboard-first task manager for teams: ...">
<meta property="og:image" content="https://orbit.noveum.ai/og.png">
<meta name="twitter:title" content="Orbit: the free, realtime, keyboard-first task manager">

/projects/some-project returns the same redirect and the same tags. There is no
og:url in either response. I verified this with curl and a Slackbot user agent
only. I did not test each chat app separately.

Where it fails

There are two separate causes. Fixing only one changes nothing in production.

1. The crawler never reaches the page. apps/web/src/app/(app)/layout.tsx:22
calls requireSession(), and apps/web/src/lib/auth/session.ts:14 redirects to
/login when there is no session. A preview crawler has no cookies, so every
URL under (app) resolves to the login page. apps/web/src/app/(auth)/login/page.tsx:14
sets only title: 'Sign in', so the Open Graph tags fall through to the root layout.

2. The pages would not describe themselves even with a session.
apps/web/src/app/layout.tsx:45-58 sets openGraph.title and twitter.title to
the landing title. The issue and project routes return a title and nothing else:

// apps/web/src/app/(app)/issue/[identifier]/page.tsx:10
return { title: identifier.toUpperCase() };

// apps/web/src/app/(app)/projects/[slug]/layout.tsx:22
return { title: slug };

Next.js inherits the parent openGraph and twitter objects when a child does
not set them, so og:title stays the landing title while <title> changes.
The project title is also the raw slug, not the project name. Saved views
(views/[id]/page.tsx:28) and every static page under (app) have the same gap.

Privacy constraint on the fix

Issues and projects are private to a workspace and identifiers are sequential.
Serving the real issue title to an anonymous request for /issue/ENG-42 would
let anyone walk the identifiers and read titles. So the anonymous preview should
carry only what the URL already says, which is the identifier or the slug. Real
titles belong to an authenticated path such as the Slack integration unfurl.

Existing pattern

apps/web/src/app/d/[token]/page.tsx with
apps/web/src/features/docs/published-doc-meta.ts already sets per-page
openGraph and twitter for published docs, and it lives outside (app) so
no redirect applies. The fix should follow that shape.

Acceptance criteria

  • An anonymous GET /issue/ENG-1 yields <title> and og:title containing
    ENG-1, with og:url set to the issue URL, not the landing title.
  • An anonymous GET /projects/<slug> does the same with the slug.
  • Neither response exposes an issue title, project name, description or
    whether the record exists.
  • A signed-out person opening the link in a browser still ends up at /login
    and returns to the link after signing in.
  • A signed-in page for an issue or project has og:title and twitter:title
    matching its <title>.
  • A test fails if og:title on these routes falls back to the landing title.

Out of scope

  • Real issue titles in anonymous previews.
  • Per-issue generated preview images.
  • The Slack integration unfurl (packages/services/src/slack), which is an
    authenticated path and was not checked here.
  • Docs pages under (app)/docs.

Conversation

Session 192e6e38-4b67-402c-b6a3-6ab566595ae1.

Size: M

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions