feat: Demo project - #572
Conversation
|
Warning Review limit reached
More reviews will be available in 3 minutes and 33 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more credits in the billing tab to continue. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis pull request adds deterministic backend demo-data generation (with S3 replay discovery, ClickHouse batching, and Redis locking), registers a DemoDataModule, and introduces a first-class /demo project route plus projectPath/projectSettingsPath wiring across frontend pages and components. ChangesDemo Analytics Generation & Frontend Routing
Possibly related PRs
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
…nescaping' Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@backend/apps/cloud/src/analytics/session-replay-s3.service.ts`:
- Around line 50-56: The decodeXmlValue function currently replaces & before
other entities causing sequences like &lt; to be double-unescaped; update
decodeXmlValue to replace the named entities (<, >, ", ') first
and only then replace & so that encoded sequences like &lt; remain <
rather than becoming <, preserving listed object keys and continuation tokens;
locate the decodeXmlValue arrow function and reorder the .replace calls
accordingly.
In `@backend/apps/cloud/src/demo-data/demo-data.service.ts`:
- Around line 41-42: The fixed LOCK_TTL_SECONDS constant allows the distributed
lock to expire mid-run (especially with BACKFILL_DAYS work), causing overlapping
generators; change the approach so the lock is either (a) renewed/heartbeated
periodically while the long-running generator/backfill work executes or (b)
allocated with an adaptive TTL computed from BACKFILL_DAYS/estimated work time
and extended before expiry; implement the renewal logic in the generator
execution path that currently uses LOCK_TTL_SECONDS (the code that
acquires/releases the distributed lock around the backfill/multi-table insert
routine) so the lock is refreshed until the run completes and only released when
fully finished.
- Around line 820-833: The redis.set call that attempts to acquire the lock
(using randomUUID(), LOCK_KEY, LOCK_TTL_SECONDS) is outside the existing try and
can throw an unhandled rejection; move the lock acquisition into the try block
or wrap the redis.set call in its own try/catch inside generateDemoData so any
Redis errors are caught and handled (log via the service logger and return
early) instead of escaping the method. Ensure the token value remains available
for release logic in the existing try/finally and do not change the lock
semantics (EX, NX) when moving the call.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: a5d79539-b7a8-4eb5-b2d3-c2d904e625f5
📒 Files selected for processing (22)
backend/.env.examplebackend/apps/cloud/src/analytics/session-replay-s3.service.tsbackend/apps/cloud/src/common/integrations/clickhouse.tsbackend/apps/cloud/src/demo-data/demo-data.module.tsbackend/apps/cloud/src/demo-data/demo-data.service.tsbackend/apps/cloud/src/task-manager/task-manager.module.tsweb/app/App.tsxweb/app/lib/constants/index.tsweb/app/pages/Project/View/ViewProject.tsxweb/app/pages/Project/tabs/AskAI/AIChart.tsxweb/app/pages/Project/tabs/AskAI/AskAIView.tsxweb/app/pages/Project/tabs/Errors/ErrorsView.tsxweb/app/pages/Project/tabs/Funnels/FunnelsView.tsxweb/app/pages/Project/tabs/Profiles/ProfileDetails.tsxweb/app/pages/Project/tabs/SEO/seo-chart-options.tsweb/app/pages/Project/tabs/Sessions/SessionDetailView.tsxweb/app/pages/Project/tabs/Traffic/TrafficView.tsxweb/app/providers/CurrentProjectProvider.tsxweb/app/routes/_index.tsxweb/app/routes/demo.tsxweb/app/routes/projects.$id.tsxweb/app/utils/routes.ts
Changes
If applicable, please describe what changes were made in this pull request.
Community Edition support
Database migrations
Documentation
Summary by CodeRabbit
New Features
Bug Fixes
Chores