Merged
Conversation
Branch naming uses hyphens (feature/lite-*) instead of slashes (feature/lite/*) because git can't create refs under an existing branch name. Mark all plan-enum tasks as complete.
…miting - Add `require_write_api!` guard to PointsController for create, update, destroy, and bulk_destroy actions. Lite users receive 403 with clear JSON error and upgrade URL. - Add `scoped_points` helper to ApiController that filters Lite users to a 12-month timestamp window. Pro and self-hoster users see all data. - Add rack-attack gem with Redis backend for per-plan rate limiting: Lite 200 req/hr, Pro 1,000 req/hr, self-hosters exempt. - Add X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset headers on all API responses for rate-limited plans. - Custom 429 response with Retry-After header and upgrade URL. - Full test coverage: 14 new specs (points write gating, read scoping, rate limit headers, throttle behavior).
Lite users see a lock badge + "Pro" label on gated layer toggles (heatmap, fog-of-war, scratch map, globe view). Clicking a gated toggle shows a 20-second live preview using the user's actual data, then auto-hides with an upgrade prompt. Globe view (which requires a page reload) shows the upgrade prompt immediately instead. - Add layer_gate.js utility with gatedToggle() and isGatedPlan() - Update routes_manager.js toggleHeatmap/toggleFog/toggleScratch to use gatedToggle — skips SettingsManager.updateSetting for Lite - Update settings_manager.js toggleGlobe to block for Lite users - Update syncToggleStates to force gated layers off on page load - Add lock icon badges to _settings_panel.html.erb for Lite users - Update lite.md with completed map-layers tasks
Backend: - Add `scoped_points` helper to ApiController for 12-month Lite window - Add `archived_points` helper returning only data older than 12 months - Support `archived=true` param on Points index — returns only archived points for Lite users, empty array for Pro/self-hoster (no archived concept) - PointsController index uses scoped_points by default, archived_points when param is set Frontend: - Add `fetchArchivedPoints` and `fetchAllArchivedPoints` to ApiClient - After main map data loads, Lite users get a background fetch of archived points rendered as a separate MapLibre layer at 30% opacity (gray circles with stroke) - Click on archived point shows upgrade prompt toast with link - Cursor changes to pointer on hover over archived data - Archived layer inserted below all active layers in z-order Tests: 4 new specs for archived param behavior (Lite returns archived, Lite excludes recent, Pro returns empty, self-hoster returns empty). 3592 examples, 0 failures.
Daily Sidekiq job checks all Lite users for data approaching archival: - 11 months: in-app warning notification - 11.5 months: email via UsersMailer#archival_approaching - 12 months: in-app banner about archived data Each threshold is tracked in user settings to prevent duplicate warnings. Scheduled daily at 03:00 via sidekiq-cron on the existing :archival queue.
1: Add lite plan
2: Feature/lite api gating
3: feat: gate map layers for Lite plan with timed preview
…miting - Add `require_write_api!` guard to PointsController for create, update, destroy, and bulk_destroy actions. Lite users receive 403 with clear JSON error and upgrade URL. - Add `scoped_points` helper to ApiController that filters Lite users to a 12-month timestamp window. Pro and self-hoster users see all data. - Add rack-attack gem with Redis backend for per-plan rate limiting: Lite 200 req/hr, Pro 1,000 req/hr, self-hosters exempt. - Add X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset headers on all API responses for rate-limited plans. - Custom 429 response with Retry-After header and upgrade URL. - Full test coverage: 14 new specs (points write gating, read scoping, rate limit headers, throttle behavior).
Lite users see a lock badge + "Pro" label on gated layer toggles (heatmap, fog-of-war, scratch map, globe view). Clicking a gated toggle shows a 20-second live preview using the user's actual data, then auto-hides with an upgrade prompt. Globe view (which requires a page reload) shows the upgrade prompt immediately instead. - Add layer_gate.js utility with gatedToggle() and isGatedPlan() - Update routes_manager.js toggleHeatmap/toggleFog/toggleScratch to use gatedToggle — skips SettingsManager.updateSetting for Lite - Update settings_manager.js toggleGlobe to block for Lite users - Update syncToggleStates to force gated layers off on page load - Add lock icon badges to _settings_panel.html.erb for Lite users - Update lite.md with completed map-layers tasks
# Conflicts: # app/controllers/api/v1/points_controller.rb # app/controllers/api_controller.rb # app/javascript/maps_maplibre/utils/layer_gate.js # config/initializers/rack_attack.rb # spec/requests/api/v1/points_spec.rb
4: feat: add data retention archival filter and archived data rendering
5: feat: add Lite archival warning jobs
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ 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 |
Lite plan for Cloud
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.
No description provided.