Feature/xapi tracking#76
Open
sei-awelle wants to merge 13 commits intomainfrom
Open
Conversation
- Add xAPI queue database table and Entity Framework migration - Implement XApiService for statement generation (ViewViewed, TeamJoined) - Implement XApiQueueService for persistent queue management - Add XApiBackgroundService for background statement delivery - Emit ViewViewed statement when user accesses a view - Emit TeamJoined statement when user is added to a team - Add XApiOptions configuration with LRS endpoint settings - Add XApiController for manual queue inspection/testing
- Add xAPI queue database table and Entity Framework migration - Implement XApiService for statement generation (ViewViewed, TeamJoined) - Implement XApiQueueService for persistent queue management - Add XApiBackgroundService for background statement delivery - Emit ViewViewed statement when user accesses a view - Emit TeamJoined statement when user is added to a team - Add XApiOptions configuration with LRS endpoint settings - Add XApiController for manual queue inspection/testing
…statements - Add EmitTeamSwitchedAsync using "switched" verb (https://w3id.org/xapi/verbs/switched) - Add team context extension (https://crucible.sei.cmu.edu/xapi/extensions/team) to all xAPI statements - Include user's active teamId in viewed, experienced, terminated, and switched statements - Add POST /api/xapi/switched/view/{viewId}/team/{teamId} endpoint - Emit team switched statement from SetPrimary handler
- Add POST /api/xapi/viewed/view/{viewId} endpoint for explicit view tracking
- Remove auto-emit from GET /api/views/{id} to prevent unwanted statements
- View viewed statement now only logs when user actively enters view, not on every GET request
Use 'accessed' verb (http://activitystrea.ms/schema/1.0/access) for application switching instead of 'experienced'. More semantically accurate for navigating to applications and matches Console's VM access pattern.
Fix xAPI validation error when application names contain spaces (e.g., 'MSEL View'). URL-encode application name before using in activity ID to ensure valid IRI format.
Ensures xAPI statements are eventually delivered to LRS even during extended outages by distinguishing transient errors (retry indefinitely) from permanent errors (fail immediately). **Transient vs Permanent Error Handling:** - Transient (retry indefinitely): Timeouts, network errors, HTTP 429/500/502/503/504 - Permanent (fail immediately): HTTP 400/401/403/422 (bad data or auth) - HTTP 409 (Conflict) treated as success (statement already exists) - Removed MaxRetryCount limit for transient errors - Increased retry delay from 5 to 30 seconds (configurable) **Stuck Processing Record Cleanup:** - Add ProcessingTimeoutMinutes config (default 10 minutes) - Add GetStuckProcessingStatementsAsync to detect orphaned records - Cleanup deletes Processing records where LastAttemptAt > timeout - Prevents accumulation of records stuck when service crashes during HTTP call **Configuration Changes:** - Add ProcessingTimeoutMinutes to XApiOptions (default 10) - Add ProcessingDelaySeconds to XApiOptions (default 30) - Both configurable via appsettings.json **Data Loss Prevention:** - LRS down 1 hour: statements keep retrying - LRS down 1 day: statements keep retrying - LRS down 7+ days: statements deleted per RetentionDays (increase if needed) - Permanent errors (bad credentials, malformed statements) fail immediately **Breaking Changes:** - IXApiQueueService.MarkFailedAsync signature changed: added bool isTransientError parameter
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.
Add comprehensive xAPI tracking for Player views, applications, and team switching
Implements xAPI statement tracking for Player user activities with team context:
Technical changes:
Verbs used:
http://id.tincanapi.com/verb/viewed- View entryhttp://activitystrea.ms/schema/1.0/access- Application accesshttps://w3id.org/xapi/verbs/switched- Team switching