feat(tracking): view/download counters and download terms modal - #1468
Merged
vcnainala merged 10 commits intoJul 28, 2026
Conversation
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 Report❌ Patch coverage is 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Summary
views/downloadscounters to projects and studies with a newInteractionTrackerservice: per-session deduplication, dataset/study interactions roll up to the owning project, and only public entities are counted (reviewer previews never are).POST /track/download/{identifier}beacon. Both are exposed throughProjectResource/StudyResourceand shown on public project and sample pages.DownloadTermsModal(content sourced fromresources/markdown/download-terms.md) requiring acceptance of the data-user terms before the download starts; acceptance fires the tracking beacon.DownloadControllerhardening 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-suppliedbucketparameter.Test plan
sail artisan test tests/Feature/InteractionTrackingTest.php(15 passed)sail artisan test tests/Unit/DownloadTermsContentTest.php(2 passed)npm run build/npm run devafter merge to see the UI changes