Skip to content

Remove the unreachable social-crawler rewrite and its page - #1554

Merged
feruzm merged 3 commits into
developfrom
fix/remove-dead-social-bot-route
Aug 20, 2026
Merged

Remove the unreachable social-crawler rewrite and its page#1554
feruzm merged 3 commits into
developfrom
fix/remove-dead-social-bot-route

Conversation

@feruzm

@feruzm feruzm commented Aug 20, 2026

Copy link
Copy Markdown
Member

Closes #1553.

The middleware rewrote social crawlers to a purpose-built /redditbot page, but that branch cannot run. It only matched the three-segment /category/@author/permlink form, and handleCategoryEntryRedirect 308s that form onto the bare canonical earlier in the same middleware (deliberately, per its own comment). Posts self-canonicalized to the bare /@author/permlink in 60a277a (2026-05-13), and the bare form never matched the pattern, so every shared link has been served the ordinary page for months.

That is the page crawlers should get. Verified against production with real crawler user agents: htmlLimitedBots gives them blocking metadata in <head> with correct og:title, og:description, og:image and twitter:card=summary_large_image, and the canonical page also carries the canonical link, JSON-LD, og:site_name, og:locale and og:image:alt that the removed page lacked. Keeping a second, unreachable source of social metadata only invites the two to disagree, which it already had.

Tests pin the two facts that made the rewrite unreachable (a crawler on the category URL is redirected like any visitor, the bare canonical is left alone) and that the crawler agents still resolve against the blocking-metadata list.

pnpm typecheck clean, pnpm test green (317 files, 2962 tests).

On the second finding, declaring og:image dimensions

Measured rather than assumed, and it is not worth doing:

  • proxifyImageSrc hardcodes mode: 'fit', and sources are not uniform (964x1280, 500x750, 1280x853 across sampled posts), so no size the site currently requests is deterministic. Declaring 1200x630 today would be declaring the wrong number.
  • Making it deterministic means a new mode=cover&width=1200&height=630 variant. Sampling five trending posts, the existing og variant was a Cloudflare HIT on 5 of 5 (age ~568s, warm because the page and JSON-LD already request it), while the cover variant missed on 2 of 5 and would be cold for every post: new imagehoster compute exactly when a crawler is first generating the card, plus a second cached copy of every post image at the edge.
  • It would also crop every portrait cover to 1.91:1 on all platforms, which is a design change rather than a metadata fix.

The crawler downloads the image regardless, so the gain is marginal. Left alone deliberately.

The middleware rewrote social crawlers to a hand-built /redditbot page, but
that branch cannot run: it only matched the three-segment
/category/@author/permlink form, and the category redirect above it 308s that
form onto the bare canonical first, deliberately. Posts self-canonicalized to
the bare /@author/permlink in May 2026, and the bare form never matched the
pattern, so every shared link has been served the ordinary page for months.

That is the right page to serve. htmlLimitedBots already gives crawlers
blocking metadata in <head>, verified in production for redditbot, Twitterbot
and facebookexternalhit, and it carries the canonical link, JSON-LD,
og:site_name, og:locale and og:image:alt that the removed page had drifted out
of sync on. Keeping a second, unreachable source of social metadata only
invites the two to disagree.

Tests pin the two facts that made the rewrite unreachable, and that the
crawlers still resolve to the blocking-metadata list.
@coderabbitai

coderabbitai Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@feruzm, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 5 minutes

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

Wait for the limit to reset, then comment @coderabbitai review or push new commits to the PR.

An organization admin can change what happens after included review limits in Billing.

How do review limits work?

CodeRabbit enforces per-developer PR review limits within each organization.

For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 2f9b0f2d-ba40-4608-8081-8e811286e874

📥 Commits

Reviewing files that changed from the base of the PR and between 41e5f56 and e213313.

📒 Files selected for processing (5)
  • apps/web/next.config.js
  • apps/web/src/app/(dynamicPages)/entry/[category]/[author]/[permlink]/redditbot/route.ts
  • apps/web/src/middleware.ts
  • apps/web/src/specs/features/next-middleware/social-bot-metadata.spec.ts
  • docs/cache/nginx.md

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@qodo-code-review

qodo-code-review Bot commented Aug 20, 2026

Copy link
Copy Markdown

PR Summary by Qodo

Remove unreachable social-crawler route and consolidate metadata

🐞 Bug fix 🧪 Tests 🕐 10-20 Minutes

Grey Divider

AI Description

• Remove the unreachable social-crawler rewrite and redundant /redditbot metadata route.
• Keep crawlers on canonical post pages with blocking social metadata.
• Test category redirects, canonical pass-through, and crawler metadata classification.
Diagram

graph TD
  A["Social crawler"] --> B["Entry middleware"] --> C{"Category URL?"} -->|Yes| D["308 redirect"] --> E["Canonical page"] --> F["Bot matcher"] --> G["Blocking metadata"]
  C -->|No| E
Loading
High-Level Assessment

The chosen approach is optimal: removing the unreachable route eliminates duplicated, drifting metadata while preserving the established canonical-page behavior. Broadening the rewrite to canonical URLs was considered implicitly but would retain a second metadata implementation, omit richer canonical metadata, and add unnecessary maintenance and image-processing risk.

Files changed (2) +61 / -11

Bug fix (1) +12 / -11
middleware.tsRemove the unreachable social-crawler rewrite +12/-11

Remove the unreachable social-crawler rewrite

• Removes user-agent detection and the rewrite to the deleted '/redditbot' route. Documents why category-prefixed crawler requests are redirected first and why canonical pages already provide richer blocking metadata.

apps/web/src/middleware.ts

Tests (1) +49 / -0
social-bot-metadata.spec.tsCover canonical social-crawler routing and metadata classification +49/-0

Cover canonical social-crawler routing and metadata classification

• Adds regression coverage proving category-prefixed crawler URLs receive a 308, bare canonical URLs remain unchanged, and major social crawler agents match 'htmlLimitedBots'.

apps/web/src/specs/features/next-middleware/social-bot-metadata.spec.ts

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Aug 20, 2026

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (2) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Action required

1. Canonical test bypasses middleware 📎 Requirement gap ☼ Reliability
Description
The canonical crawler routing tests invoke only handleCategoryEntryRedirect, so they verify helper
matching but not that the redirect precedes user-agent logic or that a canonical request completes
the full middleware flow and serves the standard page without a /redditbot rewrite. Reintroducing
or relocating a social-bot rewrite elsewhere in middleware could therefore leave the tests passing
and defeat their intended regression protection.
Code

apps/web/src/specs/features/next-middleware/social-bot-metadata.spec.ts[34]

+    expect(handleCategoryEntryRedirect(requestFor("/@alice/a-post", REDDITBOT))).toBeNull();
Evidence
PR Compliance ID 2 requires a canonical crawler request to serve the standard page without special
routing, but the added assertions call only handleCategoryEntryRedirect. Because the relevant
production ordering and removed rewrite are in the exported middleware, these tests never execute
the remaining routing chain or page response and cannot prove the absence of a later rewrite.

Pin behavior with tests: category URL redirects and canonical URL serves normal page for crawlers
apps/web/src/specs/features/next-middleware/social-bot-metadata.spec.ts[31-35]
apps/web/src/specs/features/next-middleware/social-bot-metadata.spec.ts[20-35]
apps/web/src/middleware.ts[71-103]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The social-crawler routing tests call `handleCategoryEntryRedirect` directly rather than exercising the exported middleware, so they do not verify middleware ordering or confirm that a canonical crawler request serves the ordinary page without a `/redditbot` rewrite.
## Issue Context
PR Compliance ID 2 requires an automated test for a crawler requesting `/@author/permlink` that verifies normal-page behavior, not merely that one redirect helper returns `null`. Production behavior depends on `handleCategoryEntryRedirect` running before any user-agent-specific branch and canonical post requests proceeding normally; add middleware-level tests, mocking cache dependencies or the middleware event where necessary, and assert both the category redirect and canonical no-rewrite behavior.
## Fix Focus Areas
- apps/web/src/specs/features/next-middleware/social-bot-metadata.spec.ts[20-35]
- apps/web/src/middleware.ts[71-106]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Metadata tags remain untested 📎 Requirement gap ☼ Reliability
Description
The new metadata test verifies only that crawler names match htmlLimitedBots; it never asserts
that the canonical response contains the required Open Graph, Twitter, canonical, and JSON-LD
metadata. Metadata regressions could therefore pass the suite despite removing the fallback route.
Code

apps/web/src/specs/features/next-middleware/social-bot-metadata.spec.ts[R43-46]

+    for (const agent of ["redditbot", "Twitterbot", "facebookexternalhit", "Discordbot"]) {
+      expect(new RegExp(htmlLimitedBots, "i").test(agent), `${agent} must get blocking metadata`).toBe(
+        true
+      );
Evidence
PR Compliance ID 3 explicitly requires coverage of the metadata tags on the canonical crawler page.
The added loop asserts only that four user-agent strings match a regular expression and makes no
assertion about generated metadata or rendered HTML.

Ensure canonical page contains complete, correct social metadata for crawlers (single source of truth)
apps/web/src/specs/features/next-middleware/social-bot-metadata.spec.ts[37-47]
apps/web/src/app/(dynamicPages)/entry/_helpers/generate-entry-metadata.ts[90-127]
apps/web/src/app/(dynamicPages)/entry/[category]/[author]/[permlink]/page.tsx[221-265]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The test confirms crawler classification but does not validate the metadata emitted by the canonical page.
## Issue Context
PR Compliance ID 3 requires tests or assertions covering `og:title`, `og:description`, `og:image`, `twitter:card`, canonical linkage, JSON-LD, `og:site_name`, `og:locale`, `og:image:alt`, and `twitter:site` for crawler responses.
## Fix Focus Areas
- apps/web/src/specs/features/next-middleware/social-bot-metadata.spec.ts[37-47]
- apps/web/src/app/(dynamicPages)/entry/_helpers/generate-entry-metadata.ts[90-127]
- apps/web/src/app/(dynamicPages)/entry/[category]/[author]/[permlink]/page.tsx[221-265]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

3. requestFor lacks return type ✓ Resolved 📘 Rule violation ⚙ Maintainability
Description
The new requestFor helper omits an explicit return type annotation, contrary to the requirement
for explicit types in new TypeScript code. Declare its return type as NextRequest.
Code

apps/web/src/specs/features/next-middleware/social-bot-metadata.spec.ts[R7-8]

+function requestFor(rawPath: string, userAgent: string) {
+  return new NextRequest(`https://ecency.com${rawPath}`, { headers: { "user-agent": userAgent } });
Relevance

●●● Strong

Recent PR #1531 accepted the same explicit return-type fix for a new test helper.

PR-#1531

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 2668119 requires explicit return annotations in newly added TypeScript code. The
newly added requestFor function declares its parameter types but has no return type annotation.

Rule 2668119: Disallow implicit and any types in new TypeScript code
apps/web/src/specs/features/next-middleware/social-bot-metadata.spec.ts[7-8]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The new `requestFor` TypeScript helper relies on an inferred return type instead of declaring it explicitly.
## Issue Context
`requestFor` always constructs and returns a `NextRequest`, so annotate the function with `: NextRequest`.
## Fix Focus Areas
- apps/web/src/specs/features/next-middleware/social-bot-metadata.spec.ts[7-8]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


4. requestFor lacks return type ✓ Resolved 📘 Rule violation ⚙ Maintainability
Description
The new requestFor helper omits an explicit return type annotation, contrary to the requirement
for explicit types in new TypeScript code. Declare its return type as NextRequest.
Code

apps/web/src/specs/features/next-middleware/social-bot-metadata.spec.ts[R7-8]

+function requestFor(rawPath: string, userAgent: string) {
+  return new NextRequest(`https://ecency.com${rawPath}`, { headers: { "user-agent": userAgent } });
Relevance

●●● Strong

Recent PR #1531 accepted the same explicit return-type fix for a new test helper.

PR-#1531

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 2668119 requires explicit return annotations in newly added TypeScript code. The
newly added requestFor function declares its parameter types but has no return type annotation.

Rule 2668119: Disallow implicit and any types in new TypeScript code
apps/web/src/specs/features/next-middleware/social-bot-metadata.spec.ts[7-8]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The new `requestFor` TypeScript helper relies on an inferred return type instead of declaring it explicitly.
## Issue Context
`requestFor` always constructs and returns a `NextRequest`, so annotate the function with `: NextRequest`.
## Fix Focus Areas
- apps/web/src/specs/features/next-middleware/social-bot-metadata.spec.ts[7-8]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


5. requestFor lacks return type ✓ Resolved 📘 Rule violation ⚙ Maintainability
Description
The new requestFor helper omits an explicit return type annotation, contrary to the requirement
for explicit types in new TypeScript code. Declare its return type as NextRequest.
Code

apps/web/src/specs/features/next-middleware/social-bot-metadata.spec.ts[R7-8]

+function requestFor(rawPath: string, userAgent: string) {
+  return new NextRequest(`https://ecency.com${rawPath}`, { headers: { "user-agent": userAgent } });
Relevance

●●● Strong

Recent PR #1531 accepted the same explicit return-type fix for a new test helper.

PR-#1531

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 2668119 requires explicit return annotations in newly added TypeScript code. The
newly added requestFor function declares its parameter types but has no return type annotation.

Rule 2668119: Disallow implicit and any types in new TypeScript code
apps/web/src/specs/features/next-middleware/social-bot-metadata.spec.ts[7-8]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The new `requestFor` TypeScript helper relies on an inferred return type instead of declaring it explicitly.
## Issue Context
`requestFor` always constructs and returns a `NextRequest`, so annotate the function with `: NextRequest`.
## Fix Focus Areas
- apps/web/src/specs/features/next-middleware/social-bot-metadata.spec.ts[7-8]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Tip of the day
💡 Did you know, you can copy the agent prompt from any finding and feed it to your IDE agent

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment thread apps/web/src/specs/features/next-middleware/social-bot-metadata.spec.ts Outdated
@greptile-apps

greptile-apps Bot commented Aug 20, 2026

Copy link
Copy Markdown

Greptile Summary

The PR removes the unreachable social-crawler route and middleware rewrite, relying on canonical entry-page metadata instead.

  • Adds TelegramBot to Next.js’s blocking-metadata crawler classification.
  • Updates the documented nginx bot cache class and adds regression tests for crawler routing and configuration alignment.

Confidence Score: 4/5

The PR should not merge until TelegramBot is also confirmed in the manually deployed nginx cache-key map on every production origin.

The application-side crawler classification is fixed, but the production cache boundary is configured outside the repository; updating and testing its markdown representation does not apply the required nginx change, so browser-cached HTML can still break Telegram previews.

Files Needing Attention: docs/cache/nginx.md and apps/web/src/specs/features/next-middleware/social-bot-metadata.spec.ts

Important Files Changed

Filename Overview
apps/web/next.config.js Adds TelegramBot to Next.js’s HTML-limited crawler regex so its metadata is rendered synchronously.
apps/web/src/middleware.ts Removes the unreachable crawler-specific rewrite and documents why canonical entry routing supersedes it.
apps/web/src/app/(dynamicPages)/entry/[category]/[author]/[permlink]/redditbot/route.ts Deletes the redundant crawler-only entry renderer.
apps/web/src/specs/features/next-middleware/social-bot-metadata.spec.ts Covers crawler redirects and regex alignment, but its nginx assertion validates documentation rather than the manually deployed origin configuration.
docs/cache/nginx.md Adds TelegramBot to the reference cache-key map, while production still requires an independent manual configuration rollout.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  T[TelegramBot request] --> N[Origin nginx cache]
  B[Browser request] --> N
  N --> K{Deployed bot cache-key map}
  K -->|Telegram classified| H[Dedicated htmlbot cache entry]
  K -->|Telegram absent| S[Browser-shared cache entry]
  H --> X[Next.js blocking metadata]
  S --> M[Potential browser-primed streamed response]
  D[docs/cache/nginx.md] -. manual rollout .-> K
  C[next.config.js htmlLimitedBots] --> X
Loading

Fix all with Greploop Fix All in Claude Code

Reviews (3): Last reviewed commit: "Mirror TelegramBot into the nginx cache-..." | Re-trigger Greptile

Comment thread apps/web/src/specs/features/next-middleware/social-bot-metadata.spec.ts Outdated
@qodo-code-review

qodo-code-review Bot commented Aug 20, 2026

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📜 Skill insights (0)

Grey Divider


Remediation recommended

1. requestFor lacks return type ✓ Resolved 📘 Rule violation ⚙ Maintainability
Description
The new requestFor helper omits an explicit return type annotation, contrary to the requirement
for explicit types in new TypeScript code. Declare its return type as NextRequest.
Code

apps/web/src/specs/features/next-middleware/social-bot-metadata.spec.ts[R7-8]

+function requestFor(rawPath: string, userAgent: string) {
+  return new NextRequest(`https://ecency.com${rawPath}`, { headers: { "user-agent": userAgent } });
Relevance

●●● Strong

Recent PR #1531 accepted the same explicit return-type fix for a new test helper.

PR-#1531

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 2668119 requires explicit return annotations in newly added TypeScript code. The
newly added requestFor function declares its parameter types but has no return type annotation.

Rule 2668119: Disallow implicit and any types in new TypeScript code
apps/web/src/specs/features/next-middleware/social-bot-metadata.spec.ts[7-8]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The new `requestFor` TypeScript helper relies on an inferred return type instead of declaring it explicitly.

## Issue Context
`requestFor` always constructs and returns a `NextRequest`, so annotate the function with `: NextRequest`.

## Fix Focus Areas
- apps/web/src/specs/features/next-middleware/social-bot-metadata.spec.ts[7-8]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Context sources
✅ Compliance rules (platform): 82 rules
✅ Skills: 6 invoked
  add-feature
  add-query
  add-sdk-mutation
  add-test
  code-review
  debug
Review mode: ⚖️ Balanced

Grey Divider

Tip of the day
💡 Did you know, you can copy the agent prompt from any finding and feed it to your IDE agent

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment thread apps/web/src/specs/features/next-middleware/social-bot-metadata.spec.ts Outdated
Review of the removal turned up a real gap: TelegramBot was in the rewrite's
user-agent list but never in htmlLimitedBots, so Telegram has been receiving
metadata streamed into the body, which a crawler that does not execute JS
cannot read. It is in the list now, and the test walks all eight agents the
removed rewrite used to catch rather than a sample, so a future removal from
either list fails loudly.

Also annotates the test helper's return type.
Comment thread apps/web/next.config.js
next.config.js carries an explicit warning that htmlLimitedBots is mirrored in
the origin nginx SSR cache key, and that drift makes the setting silently stop
working because a page primed by a browser is then served to a crawler from the
wrong cache namespace. Adding TelegramBot on the app side alone did exactly
that, so the documented map now carries it too.

The real fix is the test: it parses the map out of docs/cache/nginx.md and
fails on any disagreement in either direction. Verified it reports
"in next.config but not nginx: expected [ 'TelegramBot' ]" when the doc is
reverted. This drift is invisible in dev, where nothing is cached, so it needed
to be something other than a reviewer noticing.

⚠️ The deployed origin nginx map needs the same one-word addition; the repo
copy is documentation, not the running config.
Comment thread docs/cache/nginx.md
map $http_user_agent $html_limited_bot {
default "";
"~*(Mediapartners-Google|Chrome-Lighthouse|Slurp|DuckDuckBot|baiduspider|yandex|sogou|bitlybot|tumblr|vkShare|quora link preview|redditbot|ia_archiver|Bingbot|BingPreview|applebot|facebookexternalhit|facebookcatalog|Twitterbot|LinkedInBot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|Yeti)" "|htmlbot";
"~*(Mediapartners-Google|Chrome-Lighthouse|Slurp|DuckDuckBot|baiduspider|yandex|sogou|bitlybot|tumblr|vkShare|quora link preview|redditbot|ia_archiver|Bingbot|BingPreview|applebot|facebookexternalhit|facebookcatalog|Twitterbot|LinkedInBot|Slackbot|Discordbot|TelegramBot|WhatsApp|SkypeUriPreview|Yeti)" "|htmlbot";

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Production bot cache remains unsynchronized

If the production origin map has not been separately updated, this documentation-only change leaves TelegramBot in the browser cache namespace, causing browser-primed HTML with streamed metadata to produce degraded or missing Telegram link previews.

Fix in Claude Code

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, and that is the open item rather than a new one: the commit message and the earlier reply both call it out, and this PR deliberately does not change the running config.

Confirmed on both origins just now: each still carries the pre-change alternation in its $html_limited_bot map, and each has site configs using it in proxy_cache_key. Until that one-word addition is applied and nginx reloaded on both, Telegram keeps hashing into the browser namespace, exactly as described.

That edit is a production change to a hand-managed file, so it sits with the maintainer rather than in this PR. What this PR can do, and now does, is make the drift impossible to reintroduce silently: the parity test fails on any disagreement between htmlLimitedBots and the documented map, in either direction.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a fair and thorough response. The parity test is the right enforcement mechanism here — it converts a silent drift risk into a failing test, which is strictly better than hoping the two stay in sync manually. Acknowledged that the production apply is a separate, hand-managed operation outside this PR's scope.

Comment withdrawn.

@feruzm
feruzm merged commit a1263f4 into develop Aug 20, 2026
9 checks passed
@feruzm
feruzm deleted the fix/remove-dead-social-bot-route branch August 20, 2026 09:11
@feruzm

feruzm commented Aug 20, 2026

Copy link
Copy Markdown
Member Author

Correction to what I claimed on this PR, now that the deployed config has been updated and the behaviour measured.

Telegram previews were never degraded. Telegram's crawler identifies as TelegramBot (like TwitterBot), and both lists match case-insensitively on Twitterbot, so that UA already resolved to the blocking-metadata class in Next and to the |htmlbot cache namespace in nginx. Verified against the pre-change build on both origins: a Telegram UA received og:image inside <head>.

So the "TelegramBot is missing" finding, my reply built on it, and the follow-up about a browser-primed page reaching Telegram were all wrong in their premise. The listing is still worth having, since it no longer depends on Telegram happening to carry another crawler's name in its UA string, but it fixed nothing that was broken.

The deployed $html_limited_bot map on both origins now carries TelegramBot, matching docs/cache/nginx.md. Config test passed on each before reload, both reloaded cleanly, and the UA split verified afterwards: Telegram and Reddit get og:image in <head>, a browser gets it streamed in the body, on both origins.

What stands from this PR regardless: the unreachable route is gone, and the parity test now fails on any drift between htmlLimitedBots and the documented nginx map, in either direction.

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.

The /redditbot social-crawler rewrite is unreachable dead code

1 participant