Conversation
…rompt (W5)
Mac + iOS clients now send 3 activation timestamps in heartbeat:
- connection_attempted_at: first time user clicks Connect
- connection_succeeded_at: first time a connection actually establishes
- first_query_executed_at: first time user runs any query
Shared package (TableProCore):
- AnalyticsPayload: 3 new optional Date fields, ISO 8601 encoding
- AnalyticsEnvironmentProvider: 3 new protocol getters with default-nil
extension (iOS / future plugins compile without implementing them)
- AnalyticsHeartbeatService: reads new fields when building payload;
HMAC body sign covers them automatically
- New TableProAnalyticsTests target: 4 tests (ISO 8601 round-trip, nil
omission, existing fields preserved, HMAC covers new fields)
Mac (TablePro):
- MacAnalyticsProvider singleton: write-once UserDefaults pattern for the
3 timestamps + successfulConnectionCount counter + newsletterPromptShown
latch
- DatabaseManager+Sessions: markConnectionAttempted before connect;
markConnectionSucceeded + post .successfulConnectionRecorded notification
AFTER startup commands complete (partial failures don't count). Reused
connections (existing.driver != nil) intentionally not counted — only
fresh connections fire markers, matching activation funnel intent.
- DatabaseManager+Queries: markFirstQueryExecuted after successful execute
- NewsletterPromptCoordinator: singleton listening on the notification;
presents NSAlert after 3rd successful connection ('Subscribe in Browser'
opens https://tablepro.app/?subscribe=true&source=mac via NSWorkspace).
Coordinator owns the trigger rather than empty-state view because welcome
window typically closes the moment the user successfully connects.
- 7 Swift Testing tests for write-once + counter + latch independence
iOS (TableProMobile):
- IOSAnalyticsProvider: same UserDefaults write-once pattern; attached via
attach(appState:) after .shared is created
- ConnectionCoordinator: marks attempt + success around connectFresh
- QueryEditorView: marks first query after successful driver.execute
- Number-separator fix on adjacent line as part of file-touch cleanup
Adjacent fix:
- ConnectionManagerTests mock missing fetchSchemas() stub: 1-line fix
unblocks the entire TableProCore test bundle (was blocking other suites
from compiling)
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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
Mac and iOS clients now send 3 activation timestamps in the existing analytics heartbeat (
connection_attempted_at,connection_succeeded_at,first_query_executed_at), and Mac shows a native NSAlert newsletter prompt after the user's 3rd successful connection. Companion to backend PRTableProApp/license#28which adds the receiving columns and write-once server-side guard.Why
Live analytics shows 65% of installs never open a database connection — bounce is universal across every region, indicating a product onboarding leak. Prior heartbeat only sent
connection_count(peak concurrent), which conflates "user never tried" with "user tried and failed." The new timestamps let us measure the real activation funnel:Changes
Shared package (
Packages/TableProCore/Sources/TableProAnalytics/)AnalyticsPayload: 3 new optionalDate?fields, ISO 8601 encodingAnalyticsEnvironmentProvider: 3 new protocol getters with default-nil extension (so iOS / future plugins compile without explicitly implementing them)AnalyticsHeartbeatService: reads new fields when building payload; HMAC body sign covers them automaticallyTableProAnalyticsTeststarget: 4 tests (ISO 8601 round-trip, nil omission, existing fields preserved, HMAC covers new fields)Mac (
TablePro/)MacAnalyticsProvidersingleton: write-once UserDefaults pattern for the 3 timestamps +successfulConnectionCountcounter +newsletterPromptShownlatchDatabaseManager+Sessions: marks attempt before connect; marks success + posts.successfulConnectionRecordednotification AFTER startup commands complete (partial failures don't count)existing.driver != nil) intentionally not counted — only fresh connections fire markers, matching activation funnel intentDatabaseManager+Queries: marks first query after successful executeNewsletterPromptCoordinator: singleton listening on the notification; presents NSAlert after 3rd successful connection. Coordinator owns the trigger rather than empty-state view because the welcome window typically closes the moment the user successfully connects (so empty-state-tied prompt would never fire).iOS (
TableProMobile/)IOSAnalyticsProvider: same UserDefaults write-once pattern; attached viaattach(appState:)after.sharedis createdConnectionCoordinator: marks attempt + success aroundconnectFreshQueryEditorView: marks first query after successfuldriver.executeAdjacent fix
ConnectionManagerTestsmock was missingfetchSchemas()stub — 1-line fix unblocks the entireTableProCoretest bundle (was blocking other suites from compiling)Test plan
xcrun swift test --package-path Packages/TableProCore→ 47 tests, 7 suites, all pass (includes 4 new analytics tests)MacAnalyticsProviderready inTableProTests/Services/swiftlint lint --stricton all 12 modified files → 0 violations[Unreleased] / Addeddefaults read com.TableProfor the 3 new keysCompanion PR
sprint/growth-2026-05inTableProApp/licenseships the receiving end: schema migration2026_05_03_000009_add_activation_timestamps_to_analytics_events, validation rules inStoreAnalyticsRequest, and write-once defense inAnalyticsController.Out of scope
successfulConnectionCountcounter exists on iOS but has no UI hook (no iOS empty state with newsletter)