Conversation
…istence + async label workflow (#364)
…tics cleanup (#367) * perf(vercel): cut runtime costs via notification, blog cache, and analytics changes * perf(blog): remove server searchParams usage to preserve ISR
… to client-side (#370) * refactor(frontend): remove locale layout dynamic auth and move header auth client-side * fix(frontend): prevent stale auth responses in useAuth and remove redundant dashboard dynamic layout
…abs (#372) * refactor(frontend): remove locale layout dynamic auth and move header auth client-side * fix(frontend): prevent stale auth responses in useAuth and remove redundant dashboard dynamic layout * feat(frontend): sync auth state across tabs via BroadcastChannel
…tars cache (#371) * perf(quiz-flow): move quiz progress to client-side fetch, enable ISR for quizzes page - Move user progress fetch from SSR to client-side API (/api/quiz/progress) - Remove force-dynamic and getCurrentUser() from quizzes page - Add revalidate=300 for ISR caching - Use window.history.replaceState for tab URL sync (avoid Next.js navigation) - Add forceMount to TabsContent to prevent layout shift on tab switch - Fix nested <main> — use <section> inside DynamicGridBackground - Cache GitHub stars count in sessionStorage to avoid refetch + re-animation * perf: replace useRef with useState lazy initializer in GitHubStarButton Fixes React 19 react-hooks/refs ESLint error — useRef.current cannot be read during render. Uses useState(getStoredStars) to capture the sessionStorage value once on mount instead. * fix: stop star icon trembling on hover in GitHubStarButton
…zes page (#373) * perf(quiz-flow): move quiz progress to client-side fetch, enable ISR for quizzes page - Move user progress fetch from SSR to client-side API (/api/quiz/progress) - Remove force-dynamic and getCurrentUser() from quizzes page - Add revalidate=300 for ISR caching - Use window.history.replaceState for tab URL sync (avoid Next.js navigation) - Add forceMount to TabsContent to prevent layout shift on tab switch - Fix nested <main> — use <section> inside DynamicGridBackground - Cache GitHub stars count in sessionStorage to avoid refetch + re-animation * perf: replace useRef with useState lazy initializer in GitHubStarButton Fixes React 19 react-hooks/refs ESLint error — useRef.current cannot be read during render. Uses useState(getStoredStars) to capture the sessionStorage value once on mount instead. * fix: stop star icon trembling on hover in GitHubStarButton * fix: eliminate quiz timer flash on language switch Remove Suspense boundary (loading.tsx) that unmounted QuizContainer during locale navigation. Synchronous session restore via useReducer lazy initializer and correct timer initialization via useState lazy initializer prevent any visible state reset on language switch * fix: replace quiz card layout shift with skeleton grid during progress load
…out polling + add sweep indexes (#375) * (SP: 3) [Backend] add internal janitor (jobs 1-4), claim/lease + runbook (G0-G6) * (SP: 3) [Backend] add provider selector, fix payments gating, i18n checkout errors * Add shop category images to public * (SP: 3) [Shop][Monobank] I1 structured logging: codes + logging safety checks * (SP: 3) [Shop][Monobank] Fail-closed non-browser origin posture for webhook + janitor (ORIGIN_BLOCKED) * (SP: 3) [Shop][Monobank] [Shop][Monobank] J gate: add orders status ownership test and pass all pre-prod invariants * (SP: 3) [Shop][Monobank] review fixes (tests, logging, success UI) * (SP: 1) [Shop][Monobank] Tighten webhook log-code typing; harden DB tests; minor security/log/UI cleanups * (SP: 1) [Shop][Monobank] harden Monobank webhook (origin/PII-safe logs) and remove duplicate sha256 hashing * (SP: 1) [Cart] adding route for user orders to cart page * (SP: 1) [Cart] fix after review cart mpage and adding index for orders * (SP: 1) [Cart] Fix cart orders summary auth rendering and return totalCount for orders badge * (SP: 1) [Cart] remove console.warn from CartPageClient to satisfy monobank logging safety invariant, namespace localStorage cart by user and reset on auth change * (SP: 1) [Cart] rehydrate per cartOwnerId (remove didHydrate coupling) * (SP: 2)[Backend] shop/shipping schema migrations foundation * (SP: 2)[Backend] shop/shipping public routes + np cache + sync * (SP: 2)[Backend] shop/shipping: shipping persistence + currency policy * (SP: 2)[Backend] shop/shipping: webhook apply + psp fields + enqueue shipping * (SP: 2)[Backend] shop/shipping: shipments worker + internal run + np mock * (SP: 2)[Backend] shop/shipping: admin+ui shipping actions * (SP: 2)[Backend] shop/shipping: retention + log sanitizer + metrics * (SP: 1)[Backend] stabilize Monobank janitor (job1/job3) and fix failing apply-outcomes tests * (SP: 1) [db]: add shop shipping core migration * (SP: 1) [FIX] resolve merge artifacts in order details page * (SP: 1) [FIX] apply post-review fixes for shipping and admin flows * (SP: 1) [FIX] align cart shipping imports (localeToCountry + availability reason code) * (SP: 1) [FIX] hard-block checkout when shipping disabled + i18n reason mapping * (SP: 1) [FIX] harden webhook enqueue + shipping worker + NP catalog + cart fail-closed * (SP: 1) [FIX] Initialize shippingMethodsLoading to true to avoid premature checkout. * (SP: 1) [FIX] migration 17 * (SP: 1) [DB] migrarion to testind DB and adjusting tests * (SP: 1)[DB] slow down restock janitor + enforce prod interval floor * (SP: 1) [DB] add order status lite view (opt-in) + instrumentation * (SP: 1) [DB] replace checkout success router.refresh polling with backoff API polling * (SP: 1) [DB] throttle sessions activity heartbeat + use count(*) (PK invariant) * (SP: 1)[DB] enforce production min intervals for internal shipping jobs * (SP: 1) [DB] add minimal partial indexes for orders sweeps + rollout notes * (SP: 1) [DB] refactor sweep claim step to FOR UPDATE SKIP LOCKED batching * (SP: 1)[DB]: slow janitor schedule to every 30 minutes * (SP: 1)[DB] increase polling delays for MonobankRedirectStatus * (SP: 1)[FIX] harden webhooks + fix SSR hydration + janitor/np gates + sweeps refactor * (SP: 1)[FIX] harden shipping enqueue gating + apply NP interval floor
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
|
Caution Review failedThe pull request is closed. ℹ️ Recent review infoConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (27)
📝 WalkthroughWalkthroughThis pull request introduces performance optimizations, new lite-mode order status features, refactored atomic webhook operations, improved batch sweep processing, and test infrastructure improvements across frontend APIs, services, and components. Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant OrderStatusAutoRefresh
participant BackoffLoop
participant Fetch as fetchLiteOrderStatus
participant API as /api/shop/orders/[id]/status
Client->>OrderStatusAutoRefresh: Mount with paymentStatus
OrderStatusAutoRefresh->>OrderStatusAutoRefresh: Extract orderId, statusToken from URL
OrderStatusAutoRefresh->>BackoffLoop: Start bounded retry loop (MAX_ATTEMPTS, MAX_DURATION_MS)
loop Until terminal status or max attempts/duration
BackoffLoop->>Fetch: Build request (view=lite, statusToken)
Fetch->>API: GET /api/shop/orders/[id]/status?view=lite
API->>API: Parse lite response (paymentStatus)
API-->>Fetch: OrderStatusLiteSummary or error
Fetch->>Fetch: Parse paymentStatus, check terminal
alt Terminal status detected
Fetch->>OrderStatusAutoRefresh: Return paymentStatus
OrderStatusAutoRefresh->>Client: Trigger router.refresh()
BackoffLoop-->>OrderStatusAutoRefresh: Break loop
else Non-terminal, retry
BackoffLoop->>BackoffLoop: Calculate backoff + jitter
BackoffLoop->>BackoffLoop: Wait (getBackoffDelayMs with jitter)
end
alt Error or shouldStopOnError
Fetch-->>BackoffLoop: Structured error
BackoffLoop-->>OrderStatusAutoRefresh: Break loop
end
end
sequenceDiagram
participant StripeWebhook
participant ApplyStripePaidAtomic as applyStripePaidAndQueueShipmentAtomic
participant DB
participant EnsureHelper as ensureQueuedShipmentAndOrderShippingStatus
StripeWebhook->>ApplyStripePaidAtomic: Invoke with orderId, enqueueShipment flag
ApplyStripePaidAtomic->>DB: Multi-CTE flow (update_order → update_attempt → eligible_for_enqueue)
DB->>DB: Insert/update shipping_shipments (queued)
DB->>ApplyStripePaidAtomic: Return queued_shipment_count, shipmentQueued flag
alt shipmentQueued is false AND shipping prerequisites met
StripeWebhook->>EnsureHelper: Invoke ensureQueuedShipment...
EnsureHelper->>DB: Insert shipping_shipments (if not already queued)
EnsureHelper->>DB: Update order shipping_status to queued
DB-->>EnsureHelper: Return insert/update booleans
EnsureHelper-->>StripeWebhook: shipmentQueued results
else shipmentQueued is true
ApplyStripePaidAtomic-->>StripeWebhook: Return with shipmentQueued=true
end
StripeWebhook->>StripeWebhook: Compute final shipmentQueued (atomic OR ensure results)
StripeWebhook->>DB: Record shipping metrics if queued
Estimated code review effort🎯 5 (Critical) | ⏱️ ~120 minutes Possibly related PRs
Suggested reviewers
Poem
✨ Finishing Touches
🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). 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. Comment |
Summary by CodeRabbit
New Features
Bug Fixes
Refactor
Chores