Repository navigation
feat: Console SDK update for version 18.3.0-rc.3 - #117
lohanidamodar wants to merge 1 commit into
Conversation
🔵 Tier A · Mergeable after minor fixes
This update adds analytics property/event/metrics APIs and a browser 2 of 40 changed files were too large to include in full.
Note Not approving while a bug finding is open: SPA pageviews keep the document's original referrer
Fix with agent prompt### Issue 1
src/services/analytics-tracking.ts:272
**SPA pageviews keep the document's original referrer**
On each SPA navigation this calls `pageview` without the previous route, so it falls back to `document.referrer`, which remains the document's initial referrer for the whole session. As a result, analytics records stale or empty referrers for subsequent in-app pageviews instead of the route the user came from.
### Issue 2
src/services/analytics-tracking.ts:381
**Outbound events can be canceled by link navigation**
`track()` starts a regular `fetch` and doesn't wait for it, while the click handler lets same-tab navigation proceed immediately. The browser may cancel the in-flight request when unloading the page, so outbound-link events are lost on normal navigations.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.📂 Walkthrough · 5
Reviewed |
| this.currentPath = nextPath; | ||
| this.flushScrollDepth(previous); | ||
| this.flushEngagement(previous); | ||
| this.pageview(nextPath); |
There was a problem hiding this comment.
SPA pageviews keep the document's original referrer
On each SPA navigation this calls pageview without the previous route, so it falls back to document.referrer, which remains the document's initial referrer for the whole session. As a result, analytics records stale or empty referrers for subsequent in-app pageviews instead of the route the user came from.
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/services/analytics-tracking.ts
Line: 272
Comment:
**SPA pageviews keep the document's original referrer**
On each SPA navigation this calls `pageview` without the previous route, so it falls back to `document.referrer`, which remains the document's initial referrer for the whole session. As a result, analytics records stale or empty referrers for subsequent in-app pageviews instead of the route the user came from.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.🟡 Minor · bug · Reply if this doesn't apply.
| if (!target || !this.isExternal(target, includeSubdomains)) { | ||
| return; | ||
| } | ||
| this.track('outbound_link', { |
There was a problem hiding this comment.
Outbound events can be canceled by link navigation
track() starts a regular fetch and doesn't wait for it, while the click handler lets same-tab navigation proceed immediately. The browser may cancel the in-flight request when unloading the page, so outbound-link events are lost on normal navigations.
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/services/analytics-tracking.ts
Line: 381
Comment:
**Outbound events can be canceled by link navigation**
`track()` starts a regular `fetch` and doesn't wait for it, while the click handler lets same-tab navigation proceed immediately. The browser may cancel the in-flight request when unloading the page, so outbound-link events are lost on normal navigations.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.🟡 Minor · bug · Reply if this doesn't apply.
|
Closing without merging. Generating the console SDK from cloud A console RC needs generating from the videos branch, with cloud main merged in for the current analytics work, so the result is a superset of 18.3.0-rc.2 rather than a trade. Not blocking anything today: vibes pins 18.3.0-rc.2, which already has the analytics service it needs. |
Generated with sdk-generator
5.5.4.What's Changed
Trackinghelper (wasAnalyticsTracking) — construct it with theAnalyticsservice and callstart()to turn on the built-in eventsTrackingtakesnew Analytics(client)and a property id instead of an emitter callback; the adapter tocreateEventnow lives inside the SDKenableAllAutoTracking()is nowstart()AnalyticsEventEmitter; the option types are nowTrackingEventOptionsandTrackingOptionsTwo deletions, both intended
src/services/assistant.ts— the Appwrite Assistant was retired upstream, so the generator no longer emits it. No remaining consumer: vibes dropped itsAssistantimport.src/service.ts— the generator stopped emitting theServicebase class; services callClient.flatteninstead. It was never exported fromindex.ts.Verification
npm run buildproduces cjs, esm and iife bundles.Breaking only for the
18.3.0-rc.*prereleases that ship the oldAnalyticsTracking;latestis unaffected.