Skip to content

feat(tracking): view/download counters and download terms modal - #1468

Merged
vcnainala merged 10 commits into
developmentfrom
feat/interaction-tracking-download-terms
Jul 28, 2026
Merged

feat(tracking): view/download counters and download terms modal#1468
vcnainala merged 10 commits into
developmentfrom
feat/interaction-tracking-download-terms

Conversation

@vcnainala

@vcnainala vcnainala commented Jul 17, 2026

Copy link
Copy Markdown
Member

Summary

  • Adds views/downloads counters to projects and studies with a new InteractionTracker service: per-session deduplication, dataset/study interactions roll up to the owning project, and only public entities are counted (reviewer previews never are).
  • Views are recorded on public project/sample/dataset pages; downloads via a rate-limited POST /track/download/{identifier} beacon. Both are exposed through ProjectResource/StudyResource and shown on public project and sample pages.
  • All download buttons now open a DownloadTermsModal (content sourced from resources/markdown/download-terms.md) requiring acceptance of the data-user terms before the download starts; acceptance fires the tracking beacon.
  • Includes a DownloadController hardening fix as its own commit: unknown/malformed download uuids now return 404 instead of erroring, and the S3 bucket is always resolved from config rather than a user-supplied bucket parameter.

Test plan

  • sail artisan test tests/Feature/InteractionTrackingTest.php (15 passed)
  • sail artisan test tests/Unit/DownloadTermsContentTest.php (2 passed)
  • Manually verify terms modal appears for project, sample, and file downloads
  • Requires npm run build / npm run dev after merge to see the UI changes

Return 404 when the download uuid is missing, malformed or unknown
instead of erroring, and always resolve the S3 bucket from filesystem
config rather than trusting a request parameter.
…wnloads

Add views/downloads counters to projects and studies, an
InteractionTracker service that deduplicates per session, rolls dataset
and study interactions up to the owning project, and only counts public
entities (never reviewer previews). Views are recorded on the public
pages and downloads via a rate-limited POST /track/download/{identifier}
beacon; both counters are exposed through the project and study
resources.
Display view and download counts on public project and sample pages,
and require accepting the data-user terms (DownloadTermsModal backed by
resources/markdown/download-terms.md) before any download starts. On
acceptance the download-tracking beacon is fired and the download
proceeds.
@codecov

codecov Bot commented Jul 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.86992% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.85%. Comparing base (fc468e9) to head (d673705).
⚠️ Report is 1 commits behind head on development.

Files with missing lines Patch % Lines
app/Http/Controllers/ApplicationController.php 80.95% 4 Missing ⚠️
app/Services/InteractionTracker.php 95.71% 3 Missing ⚠️
app/Http/Controllers/ProjectController.php 85.71% 2 Missing ⚠️
app/Http/Controllers/DownloadController.php 80.00% 1 Missing ⚠️
Additional details and impacted files
@@                Coverage Diff                @@
##             development    #1468      +/-   ##
=================================================
+ Coverage          78.75%   78.85%   +0.09%     
- Complexity          4316     4355      +39     
=================================================
  Files                287      289       +2     
  Lines              16010    16114     +104     
=================================================
+ Hits               12608    12706      +98     
- Misses              3402     3408       +6     
Flag Coverage Δ
unittests 78.85% <91.86%> (+0.09%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@vcnainala
vcnainala merged commit c1c8a2f into development Jul 28, 2026
5 checks passed
@vcnainala
vcnainala deleted the feat/interaction-tracking-download-terms branch July 28, 2026 08:21
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