Replaced `text.split("\n")` and heavy string operations (`trim`, `startsWith`, `includes`, etc) with an optimized, index-based string scanner using `indexOf("\n")` and `charCodeAt`.
This drastically reduces memory allocation and string garbage collection for large blocklist files.
Benchmark results:
- Original implementation: ~3650ms per 100 runs
- Optimized implementation: ~2360ms per 100 runs
- Measured Improvement: ~35% faster execution time.
Replaced the two-pass `.filter().map()` iteration for calculating obsolete DNS records with a single-pass `.reduce()`. This optimization avoids unnecessary intermediate array allocations, reducing runtime overhead for parsing large sets of existing DNS records.
* chore: update dependencies and fix vitest config for Node test parallelism
Bump Node to 24.14.1, TypeScript to 6.0.2, turbo 2.9.6, biome 2.4.12, better-auth to 1.6.3, React to 19.2.5, Next.js to 16.2.3, @trpc/* to 11.16.0, @tanstack/react-query to 5.99.0, and various other minor/patch bumps across the monorepo.
Add a next/image mock for Vitest and replace vite-tsconfig-paths with Vite's built-in tsconfigPaths option.
Set fileParallelism: false on the Node test pool to prevent MSW resetHandlers() races between test files.
Fix infiniteQueryOptions call signature in use-notifications-data to pass options as the second argument.
Fix optional chaining on map.getLayer() to guard against a null map reference.
* chore: migrate from biome to oxlint+oxfmt
Update dependencies across the monorepo including better-auth 1.5.0,
@trpc/* 11.11.0, ai SDK, turbo 2.8.12, and various minor/patch bumps.
Add @better-auth/infra for dash() and sentinelClient() plugins.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The test only mocked Cloudflare DNS, but resolveHostIps picks provider
order by domain hash. When Google was tried first it returned empty
records, triggering a retry + fallback that added enough latency to
intermittently exceed the 5s test timeout.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The DropdownMenuTrigger renders a TooltipTrigger wrapping a div, not a
native <button>, so Base UI's nativeButton check needs to be disabled.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move render-phase ref writes into useEffect, replace derived state
useEffect with useMemo, extract JSX from try/catch, fix memoization
dependencies, add passive event listeners, and add missing href.
Raises react-doctor score from 73 to 77 (54 → 45 errors).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ChatClient and its ~1MB+ of dependencies (AI SDK, motion, etc.) were
shipped to every visitor. Insert a lightweight gate component that only
loads the chat chunk when AI features are enabled.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add rounded-[inherit] to the mesh gradient background so it clips
to the parent's border-radius before the blur filter expands it.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add structured logging to @domainstack/safe-fetch via @domainstack/logger
- Make @domainstack/blob file-type agnostic (remove image-specific logic)
- Move storeImage() from blob to @domainstack/image package
- Remove duplicate files from web app (puppeteer, storage, blob, image)
- Remove unused dependencies from web app package.json
- Update all consumers to use consolidated package imports
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
If limiter.limit() throws (e.g., Redis connection error), the exception
bubbled up through checkRateLimit without being caught. Since checkRateLimit
was called outside the route handler's try/catch block, this caused the
handler to return undefined instead of a Response, triggering:
"No response is returned from route handler"
The fix wraps the Redis call in a try/catch that fails open, consistent
with the existing fail-open strategy for missing identifiers or Redis.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Apply disabled cursor styling to wrapper divs since they intercept
pointer events. Refactor linked-account-row to only use tooltip
wrapper when button is actually disabled.
- Added a new "clean" script to package.json for removing build artifacts.
- Updated devDependencies to include "shx" for shell command execution.
- Bumped versions of several packages including pg, @posthog/ai, and @posthog/nextjs-config.
- Adjusted pnpm-lock.yaml and pnpm-workspace.yaml to reflect updated package versions.
- Deleted the BookmarkletsPage and InterceptedBookmarkletsPage components.
- Removed the BookmarkletContent component, which handled the rendering of bookmarklet functionality.
- Updated the AppFooter to integrate bookmarklet functionality directly within a dropdown menu, enhancing accessibility and user experience.
- Adjusted className in ChatFab for improved styling.
- Replaced IconBrandChrome with IconDeviceLaptop in ChatModeSelector for better representation of local mode.
- Updated icon usage in local mode selection to enhance UI consistency.
Move query and mutation logic from AccountPanel to a dedicated hook:
- Query for linked accounts with loading/error states
- Unlink mutation with optimistic updates and rollback
- Link provider function with error handling
- Derived state (linkedProviderIds, canUnlink)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Move queries and 2 mutations from NotificationsPanel into dedicated
hook. Hook handles global preference updates and domain muting with
optimistic updates. Component now focuses on UI rendering.
Reduced component from 252 to ~110 lines.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Move query and 4 mutations (enable, disable, rotate, delete) from
CalendarInstructions into dedicated hook. Hook handles all cache
manipulation and optimistic updates. Component now focuses on UI.
Reduced component from 446 to ~350 lines.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Update DashboardProvider to accept filterHook and paginationHook
results directly instead of destructuring and reconstructing.
Reduces boilerplate in dashboard-client.tsx.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Move all query and mutation logic from NotificationsPopover into a
dedicated hook. Improves separation of concerns - popover handles
UI state, hook handles data fetching with optimistic updates.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Accept TrackedDomainWithDetails directly instead of 12 individual props.
Reduces prop drilling and simplifies parent component.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Move chat open state to Jotai atom for programmatic control
- Remove redundant submitError state (useChat already provides error)
- Remove clearError callback and onClearError prop
- Simplify sendMessage to silently reject empty input
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Move selection state from React Context to Jotai for cleaner architecture:
- Add dashboard-atoms.ts with selection atoms and derived state
- Add use-dashboard-selection.ts hook using the atoms
- Slim down DashboardContext from 363 to 210 lines
- Remove selection state/actions from context (now in Jotai)
- Update 7 consumer components to use new selection hook
Selection is now global via Jotai - no provider boundary needed.
Context retains only: actions, filters, pagination (forwarded from hooks).
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Extract composition pattern hooks from large client components:
- use-dashboard-filters: URL-synced filter state via nuqs
- use-dashboard-pagination: URL/localStorage-synced pagination
- use-dashboard-mutations: TanStack Query mutations with optimistic updates
- use-chat-persistence: Chat message persistence to Zustand store
- use-section-tracking: Scroll-based active section detection
Remove redundant snapshot system (dashboard-store.ts):
- Browser history via router.back() already preserves filter state
- Snapshot was capturing already-cleared state due to nuqs timing
- Reduces ~200 lines of unnecessary abstraction
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Lift useScreenshot hook to ScreenshotPopover so polling continues when the popover closes. Previously, the query lived inside PopoverContent which unmounts on close, causing re-hover to start a second workflow run.
- Added new client-safe domain utilities, including `normalizeDomainInput` and `isValidDomain`, to the `@domainstack/core` package for improved domain handling in client-side applications.
- Updated various components and hooks to utilize the new domain utilities, enhancing code consistency and maintainability.
- Removed deprecated domain utility imports from the codebase to streamline functionality and reduce redundancy.
- Introduced tests for the new domain utilities to ensure robust behavior and accuracy in domain processing.
The error classification was too broad - any error containing 'fetch'
was shown as a network error. This caused server errors from the
WorkflowChatTransport (e.g., 'Failed to fetch chat: 500') to be
incorrectly displayed as connection problems.
Now only actual browser-level network failures trigger the connection
error message (TypeError with 'failed to fetch', ECONNREFUSED, etc.).
- Introduced new repository files for various entities including blocked domains, calendar feeds, certificates, and more to enhance modularity and maintainability.
- Removed deprecated files related to verification and blocked domains to streamline the codebase.
- Updated database schema with new indices and constraints to improve query performance and data integrity.
- Added new utility functions and types for better type safety and clarity in repository interactions.
- Enhanced testing coverage for new repository functionalities to ensure robust behavior across the application.
- Added comprehensive tests for DNS query functions, including `queryDohProvider` and `filterAnswersByType`, ensuring robust handling of various response scenarios.
- Introduced a new test suite for provider catalog parsing, validating input and error handling for provider configurations.
- Implemented tests for rule evaluation logic, covering various header and MX-related rules to ensure accurate detection.
- Created tests for TLS certificate fetching, verifying correct handling of certificate chains and error scenarios.
- Added WHOIS lookup tests to validate error handling and response parsing for domain queries.
- Removed deprecated dependencies from package.json, specifically `@sparticuz/chromium` and `puppeteer-core`.
- Updated various package versions across the project, including `next`, `@ai-sdk/gateway`, `@ai-sdk/react`, and others to their latest compatible versions.
- Introduced a catalog for shared dependencies in pnpm workspace configuration to streamline version management.
- Adjusted peer dependencies for `zod` in the core package to ensure compatibility.
- Enhanced overall dependency management for improved maintainability and consistency across the codebase.
- Added a new `@domainstack/core` package to centralize domain-related functionalities, including provider detection, DNS-over-HTTPS queries, TLS certificate fetching, and WHOIS/RDAP lookups.
- Updated existing modules to utilize the new core package, enhancing maintainability and consistency across the codebase.
- Removed deprecated utilities and streamlined imports to improve code clarity and organization.
- Enhanced tests for the new package to ensure robust functionality and error handling.
- Removed the hardcoded USER_AGENT from various modules, replacing it with process.env.EXTERNAL_USER_AGENT for consistency.
- Deleted the unused constants file and cleaned up related imports across the codebase.
- Updated the safe-fetch package to support optional user-agent handling and improved logging capabilities.
- Enhanced tests for safe-fetch to ensure robust functionality and error handling.
- Adjusted the width of the suffix skeleton in `KeyValueSkeleton` for better alignment.
- Enhanced the `CopyButton` in `KeyValue` with additional margin and text styling for improved visibility.
- Renamed the icon variable in `ReportSectionSkeleton` for clarity and updated the class names for better responsiveness.
- Modified the `RegistrationSectionSkeleton` to use a smaller width for the "Created" and "Expires" labels, improving overall layout consistency.
- Added a new `@domainstack/safe-fetch` package to provide a secure and efficient way to fetch resources with SSRF protection.
- Implemented features to validate DNS resolution, handle redirects, and enforce size limits on responses.
- Integrated the new safe-fetch functionality into existing components and workflows, replacing previous fetch implementations.
- Updated various modules to utilize the new safe-fetch methods, ensuring consistent user-agent handling and improved error management.
- Removed deprecated fetch utilities to streamline the codebase.
- Created a new `constants` package to centralize shared constants across the application.
- Added constants for domain management, email configurations, and HTTP headers.
- Updated existing components and workflows to utilize the new constants for improved maintainability and consistency.
- Removed deprecated constants from previous locations to streamline the codebase.
- Updated the `usePreferencesHydrated` hook to set the initial hydration state to false and check hydration status immediately after the effect runs.
- Improved the cleanup function for the hydration subscription to ensure proper unsubscription.
- Added documentation reference for checking store hydration status.
- Replaced `ChatTrigger` with `ChatServer` in the layout for improved chat functionality.
- Introduced a new `ChatFab` component for initiating chat interactions with animated effects.
- Refactored `ChatClient` to manage chat state and suggestions more effectively.
- Updated `ChatPanel` to enhance user experience with better message handling and loading indicators.
- Adjusted styles and animations for improved usability across devices.
- Introduced TypeScript configuration files for various project setups including base, Next.js, and React library.
- Added a new UI component library with foundational components such as Button, Modal, and Accordion.
- Updated existing components to utilize the new UI library for consistency and improved styling.
- Enhanced utility functions and hooks for better integration with the new component architecture.
- Introduced a new `DashboardContext` to manage selection and domain actions across dashboard components.
- Replaced individual prop drilling for selection and actions with context hooks for cleaner component structure.
- Updated `ArchivedDomainsList`, `DashboardClient`, `DashboardContent`, `DashboardGrid`, and `DashboardTable` to utilize the new context.
- Removed the deprecated `useDashboardSelection` hook in favor of context-based selection management.
- Enhanced bulk action handling and selection state persistence across component updates.
- Added Jotai for managing UI state in chat and search components, replacing Zustand stores.
- Updated `ChatTriggerClient` to use local state for UI interactions.
- Refactored search components to utilize Jotai atoms for managing search focus and pending domain state.
- Removed unused Zustand stores for header and home search, streamlining state management.
- Replaced Popover with Sheet for chat UI on non-mobile devices to enhance layout and usability.
- Added vibration feedback on chat button click.
- Streamlined chat header actions and improved accessibility with updated icons.
- Adjusted styles and animations for better user experience.
- Added LRU cache for Cloudflare IP check results to optimize repeated checks across requests.
- Refactored IP fetching logic to improve error handling and response parsing.
- Introduced Redis caching for GeoIP lookups to reduce external API calls and improve performance.
- Updated domain normalization to utilize LRU caching for repeated lookups.
- Updated `RawDataDialog` to use a functional state update for toggling line wrapping.
- Refactored `useBulkOperations` to utilize built-in mutation states instead of manual loading states.
- Simplified `useDashboardPagination` by removing unnecessary memoization.
- Streamlined `useDashboardSelection` by eliminating redundant memoization for selected IDs.
- Enhanced `useScrollDirection` and `useTruncation` to use `startTransition` for smoother state updates during scroll and truncation calculations.
- Introduced `PlanStatusCard` and `UpgradeCard` components to improve the display of subscription details and upgrade options.
- Updated `AddDomainContent` and `SubscriptionPanel` components to utilize the new cards for better user experience.
- Refactored existing code to remove redundant elements and streamline the layout.
- Replaced `IconPasswordFingerprint` with `IconShieldLock` in the CalendarInstructions component for improved security representation.
- Swapped `IconSortDescending` and `IconSortAscending` in the GridSortDropdown component to correct sort direction icons.
- Changed `IconMeteor` to `IconHandLoveYou` in the AddDomainContent component for better visual alignment with the plan description.
- Updated `IconSourceCode` to `IconZoomCode` in the RawDataDialog component to enhance clarity in the raw data view button.
- Introduced a new `VibrationProvider` to manage vibration functionality based on user interactions.
- Implemented vibration feedback in `PromptInputTextarea`, `Suggestion`, `ChatClient`, and `ChatTriggerClient` components to enhance user experience.
- Updated `Providers` to include the `VibrationProvider` for global access to vibration features.
- Introduced a new `DomainLayout` component to manage layout-specific CSS variables.
- Removed the `useLayoutVariables` hook as its functionality is now integrated directly into the layout components.
- Updated various components to utilize CSS variables for header and section navigation heights, ensuring consistent styling across the application.
- Cleaned up related styles and adjusted scroll margin calculations for improved layout behavior.
- Replaced batch processing with Promise.allSettled for improved efficiency in checking certificate, domain, and subscription expiries.
- Simplified logging to focus on the number of started workflows rather than detailed success/failure counts.
- Consolidated notification preference checks and expiry notification logic into shared workflow steps for better maintainability.
- Removed deprecated section revalidation workflow to reduce complexity and improve clarity in the codebase.
- Removed unnecessary icons and adjusted text sizes in various components for a cleaner look.
- Streamlined modal and dialog components by reducing padding and margin inconsistencies.
- Improved layout of the Calendar Feed popover and Bookmarklet page for better user experience.
- Updated AlertDialog components to simplify structure and enhance readability.
- Removed GearIcon from settings modal and tabs for a cleaner look.
- Adjusted padding and margin in various components for better spacing.
- Updated notification empty state and settings card styles for improved visual consistency.
- Enhanced modal styles to ensure proper background and border settings.
- Refactored notification matrix and settings content for better alignment and readability.
- Added mute/unmute capability for tracked domains, allowing users to manage notification preferences more effectively.
- Introduced `DomainMuteList` component for displaying and managing muted domains.
- Updated relevant components and hooks to support the new mute functionality, including optimistic updates for UI responsiveness.
- Removed the deprecated `DomainOverrides` component to streamline notification settings management.
- Adjusted database schema to include a `muted` field for tracked domains, replacing the previous notification overrides structure.
- Changed the height class for the Conversation component from `h-full` to `min-h-full` to improve layout consistency and prevent overflow issues in the chat interface.
Add maxAgeMs option to withSwrCache that refuses to return stale data
older than the threshold, instead waiting for fresh data like a cache
miss.
- Add MAX_AGE_* constants to ttl.ts (2-4x staleness TTL)
- Add fetchedAt to CacheResult for age calculation
- Update all 8 cache getters to return fetchedAt
- Apply maxAgeMs to domain router (except favicons which are cosmetic)
This ensures users don't see extremely outdated domain information
while still benefiting from SWR for moderately stale data.
- Deleted the deduplication module and its associated tests to simplify workflow management.
- Updated various components to directly start workflows without deduplication, enhancing clarity and reducing complexity.
- Adjusted background revalidation logic to fire-and-forget without relying on deduplication keys.
- Cleaned up imports and ensured consistent error handling across workflow triggers.
- Bumped versions of several dependencies including `@ai-sdk/gateway`, `@ai-sdk/react`, and `@opentelemetry/instrumentation-pino`.
- Refactored icon imports across components, replacing `IconBadge` with a new `Icon` component for improved consistency.
- Updated various components to utilize the new icon structure and adjusted styles for better visual alignment.
- Cleaned up unused imports and ensured proper icon usage throughout the application.
- Introduced DrawerHandle component for improved drawer functionality.
- Updated DrawerContent to utilize DrawerHandle for better structure.
- Added useVisualViewport hook to track visual viewport size and keyboard presence, enhancing user experience on mobile devices.
- Added an optional onExpand prop to AutoExpandTool for triggering actions when the tool auto-expands.
- Updated useEffect to call onExpand when the stream is complete.
- Adjusted ChatClient to pass handleScrollToBottom as the onExpand handler.
- Improved ShimmeringText component styling for better visual consistency.
- Removed the ical-generator dependency and replaced it with ts-ics.
- Updated the calendar generation logic to utilize the new library's API.
- Enhanced event creation with improved structure and properties for better compatibility.
- Updated ChatClient to accept pre-generated suggestions from the server.
- Introduced ChatTriggerClient to manage chat interactions and settings.
- Refactored ChatTrigger to generate randomized suggestions based on Edge Config domains.
- Improved icon usage in ChatClient for better visual consistency.
- Adjusted AI preferences handling to ensure proper state management.
- Removed the `@lobehub/icons` dependency and replaced its icons with those from `@icons-pack/react-simple-icons`.
- Updated the MCP page to use SVG icons directly for better performance and consistency.
- Cleaned up unused icon components to streamline the codebase.