Repository navigation
fix: keep crawlers out of event counts, keep preview cards, and file approved planner decisions - #83
Merged
Merged
Conversation
…approved planner decisions track drops bot requests, page openGraph keeps the site name and root card, /data share and spec URLs send X-Robots-Tag, approved choices file planner decisions by choice_id, a refused chip refunds the guest prompt, shared wordings are numbered in the entity menu, and a stale switch without a current card ends read-only.
…nction stream refunds a metered turn's prompt on any refusal, as meterTurn does. src/proxy.ts sets /data's X-Robots-Tag from dataPageRobots, the function the page metadata uses. Preview cards carry their size and type, and a gallery dataset previews with its own card.
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.
Fixes from a review of the website release (dev into main, #81). None of these breaks a page on its own, but three need to ship with that release: crawlers would be counted as share and embed views, a shared gallery search would lose its preview card, and once dfo-ai's planner decisions ship an approved plan would file them under "Counted as".
track(src/lib/events/track.ts) returns before the log line, the database row and the PostHog forward when the request comes from a bot (isBotRequestin the newsrc/lib/bot.ts, on theisbotpackage the repo pins). The release opens/s/and/embed/to crawlers, and theeventtable keeps no user agent, so those rows could not be told apart later.requestLog.tsuses the same check.pageOpenGraph(src/lib/site.ts), which keeps the site name and the root card image unless a page has its own card, so/data?share=<gallery id>previews with the image again./data?spec=and a/data?share=that is not a gallery dataset now sendX-Robots-Tag: noindex, nofollow(noindexHeadersinsrc/lib/crawl.ts), so their noindex no longer depends on when the streamed metadata reaches the head. A test matches each URL with Next's owngetPathMatchandmatchHasand checks the header agrees with the page metadata.choice_id(approvedViewinsrc/lib/studio/plan.ts), which dfo-ai sends onplan.approvedfrom ai#106. A plan stored in a chat before that has no ids and reads as before.scope_choice_stale) no longer spends a guest prompt (withRefusedChipmarks it refunded,Studio.tsxsubtracts it).entity_choiceorder (entityChoiceLabels).refusedSwitch), andcanSwitchandisStaleare the single tests the plan code uses.Testing: lint, CSS lint, typecheck and build pass; the full test suite passes (2,078, including the database suite) and the later search, studio and chat runs pass (1,609). Each change has a test that fails on
dev. Undernext start,/data?share=zzzzand/data?spec=xsend the header and a gallery share does not.