Repository navigation
fix: batch analytics events, unique pool slugs, keep UTM on share links, flag high fee bumps - #852
Merged
ritaifeoluwa merged 2 commits intoNov 18, 2026
Conversation
…ks, flag high fee bumps Closes SmartDropLabs#750 Closes SmartDropLabs#751 Closes SmartDropLabs#752 Closes SmartDropLabs#753
👷 Deploy request for smart-drop pending review.Visit the deploys page to approve it
|
👷 Deploy request for spiffy-melomakarona-eb1e8a pending review.Visit the deploys page to approve it
|
|
@benfoster-dev Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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.
Closes #750
Closes #751
Closes #752
Closes #753
What changed
analytics.ts:trackEventnow queues events instead of calling the provider once per event. The queue flushes when it reachesANALYTICS_BATCH_SIZE(10),ANALYTICS_FLUSH_INTERVAL_MS(5s) after the first queued event, or onpagehide/visibilitychange: hidden, so queued events aren't lost on navigation.flushAnalytics()is exported, and public-key hashing is unchanged. Newanalytics.test.ts.pool-slugs.ts: newgenerateUniquePoolSlugs(pools). Pools with a unique short slug keep it unchanged; pools that share one get the shortest longer id tail that tells them apart. That depends only on the colliding ids, not on list order, so slugs don't swap when the list is reordered.extractPoolIdFromSlugandgenerateStaticParamsuse these slugs, and a short slug shared by two pools no longer resolves to whichever was listed last. Tests added.share-url.ts:buildShareUrladds the visit'sutm_*params to the link unless the link already sets them.rememberUtmParams()stores the landing page's UTM params insessionStorage;AppShellcalls it on each navigation, so attribution survives moving away from the landing page. Newshare-url.utm.test.ts.feeBumpGuard.ts: addsHIGH_FEE_BUMP_STROOPS(1 XLM),isHighFeeBumpandhighFeeBumpWarning./api/sign-fee-bumplogs an unusually high bump fee server-side and returns awarningfield, whichrequestFeeBumplogs. The bump fee scales with the caller-supplied inner fee, so this flags inflated inner fees. Tests added; the route test'sfeeBumpGuardmock gains the new export.Why
How to test
npm test -- src/lib/analytics src/lib/pool-slugs src/lib/share-url src/lib/feeBumpGuard src/app/api/sign-fee-bumpNote: not run locally; I'm relying on CI. Three choices worth calling out:
FarmPoolRowstill builds its links row by row fromsymbolandcontractAddress, so for a colliding pair the list link now resolves to "not found" rather than the wrong pool. A full fix needs the farm page to pass list-aware slugs intoFarmPoolRow.AppShell.tsxonmainrendered<ServiceWorkerRegistrar>without importing it; the import is added here because this PR edits that file.Also seen on
mainand not touched:src/app/layout.tsximportsAppShelltwice and renders it twice, which looks like a merge leftover.