Fix hardcoded 5% analytics growth across all providers#1327
Open
tcpsyn wants to merge 1 commit intogitroomhq:mainfrom
Open
Fix hardcoded 5% analytics growth across all providers#1327tcpsyn wants to merge 1 commit intogitroomhq:mainfrom
tcpsyn wants to merge 1 commit intogitroomhq:mainfrom
Conversation
The percentageChange field was hardcoded to 5 in X, Facebook, LinkedIn Page, Instagram, and Threads providers, always showing fake 5% growth regardless of actual data. Added calculatePercentageChange utility that computes real percentage change by comparing first half vs second half of time-series data. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
@tcpsyn is attempting to deploy a commit to the Listinai Team on Vercel. A member of the Team first needs to authorize it. |
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
percentageChangefield in analytics data was hardcoded to5in five social media providers (X/Twitter, Facebook, LinkedIn Page, Instagram, Threads), causing the analytics dashboard to always display a fake 5% growth indicator regardless of actual datacalculatePercentageChange()utility function that computes real percentage change by comparing the first half vs second half of time-series data0instead of a misleading numberAffected Providers
x.provider.tspercentageChange: 5→ now calculated from metric datafacebook.provider.tspercentageChange: 5→ now calculated from daily insightslinkedin.page.provider.tspercentageChange: 5→ now calculated from page analyticsinstagram.provider.tspercentageChange: 5in 2 places → calculated for time-series,0for aggregatesthreads.provider.tspercentageChange: 5→ calculated for daily data,0for total_valueNew File
libraries/nestjs-libraries/src/integrations/social/analytics.utils.ts— shared utility that:((secondHalfSum - firstHalfSum) / firstHalfSum) * 100, rounded to 1 decimal0for edge cases (< 2 data points, zero first-half sum)Test plan
🤖 Generated with Claude Code