Skip to content

1.3.2#2350

Merged
Freika merged 54 commits intodevfrom
version/1.3.2
Mar 8, 2026
Merged

1.3.2#2350
Freika merged 54 commits intodevfrom
version/1.3.2

Conversation

@Freika
Copy link
Owner

@Freika Freika commented Mar 4, 2026

No description provided.

Freika and others added 30 commits March 1, 2026 21:25
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.
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).
Freika and others added 15 commits March 2, 2026 22:34
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
@Freika Freika changed the title Update version 1.3.2 Mar 4, 2026
@coderabbitai
Copy link

coderabbitai bot commented Mar 4, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a9855d35-247f-4309-911c-62bcb1691907

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch version/1.3.2

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Freika Freika merged commit b99fe83 into dev Mar 8, 2026
8 of 9 checks passed
@Freika Freika deleted the version/1.3.2 branch March 8, 2026 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant