Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
All tests pass and type-check succeeds. Here's the review:
Review: Smoke-test /papers basePath with Telegram deep links
Change summary
This is a multi-feature branch that bundles several merged PRs (#22, #24, #25, #26, #28) plus the basePath/deep-link work. The changes relevant to the stated objective:
packages/config/src/index.ts— AddsPAPERS_PUBLIC_URLandPAPERS_BASE_PATHto the config schema (with defaults for local dev).packages/contracts/src/index.ts— AddsbuildDeepLink()and convenience wrappers (paperDeepLink,profileDeepLink,feedDeepLink,groupDeepLink,conferenceDeepLink) that correctly composepublicUrl + basePath + routefor external/Telegram links.packages/contracts/test/index.test.ts— 10 new test cases covering: leading-slash normalization, trailing-slash stripping, empty basePath, localhost, and all entity-specific helpers.apps/web/next.config.ts— Addsoutput: "standalone"andserverExternalPackages; retainsbasePath: "/papers"..env.example— Documents the two new env vars.Bundled alongside (not the focus, but in the diff): groups feature, health endpoint, Dockerfile, skeleton loading, R2 client, PDF metadata scrubbing, Node 22 downgrade.
Validation confidence: High
npm run test— all 7 workspaces pass (contracts tests explicitly validate deep link correctness).npm run check— full Next.js build + tsc succeeds; all routes compile including/papersbasePath.buildDeepLinkfunction is straightforward string composition with proper slash handling — low surface area for bugs.Remaining risks
@papers/contractsbut nothing in the control-plane/bridge imports them yet. Until the bot actually callspaperDeepLink(cfg.PAPERS_PUBLIC_URL, cfg.PAPERS_BASE_PATH, slug), this is tested but not integrated end-to-end.basePathis hardcoded innext.config.tsbasePath: "/papers"is a static string, not driven byPAPERS_BASE_PATHenv var. Next.js requiresbasePathat build time, so this is expected — but the config default and the hardcoded value must stay in sync manually.paperDeepLinkproduces/papers/papers/slug/papers+ route/papers/slug), and the test asserts it. Just worth noting the double-paperssegment is correct for the deployment topology.