Skip to content

Conversation

@joe-replin
Copy link
Contributor

New

  • Added comprehensive offline statement queue system for reliable xAPI statement delivery in high-traffic and poor connectivity scenarios
  • Created OfflineQueueModel.js to manage statement batching, queuing, and intelligent retry logic
  • Created CreatedStatementModel.js for queue creation tracking statements
  • Created ReleasedStatementModel.js for successful queue flush tracking statements
  • Integrated offline queue functionality into StatementModel.js:
    • Automatic queuing of failed statements after exhausting retry attempts
    • Configurable retry delays with exponential backoff (up to 5 attempts)
    • Intelligent batch flushing when queue threshold is reached
    • Opportunistic queue flushing after successful statement sends
    • Force queue flushing on course completion and window unload
  • Added queue event handlers (onQueueCreate, onQueueRelease) and send methods (sendCreated, sendReleased)
  • Added comprehensive offline queue configuration in example.json:
    • _isEnabled: Enable/disable queue functionality (default: true)
    • _retryDelays: Configurable retry delays array with exponential backoff [0, 2000, 5000, 10000, 20000]ms
    • _requestTimeout: Maximum timeout for initial statement sends (20000ms recommended)
    • _queueFlushTimeout: Timeout for queued statement sends during flush (10000ms)
    • _queueThreshold: Minimum statements required before automatic batch flush (5 statements)
  • Added complete "Offline Queue Configuration" documentation section in README with:
    • Detailed property descriptions and behavior explanations
    • Recommended settings for high-traffic deployments (200k+ users)
    • Critical vs normal statement handling documentation
  • Added created and released verbs to xAPI verbs table in README
  • Replaced _.extend() with Object.assign() in ReleasedStatementModel.js for ES6 compliance

Testing

  1. Install or ensure xAPI LRS connection is configured
  2. Enable offline queue in course/config.json:
    "_xapi": {
      "_tracking": {
        "_offlineQueue": {
          "_isEnabled": true,
          "_retryDelays": [0, 2000, 5000, 10000, 20000],
          "_requestTimeout": 20000,
          "_queueFlushTimeout": 10000,
          "_queueThreshold": 5
        }
      }
    }

@joe-replin joe-replin self-assigned this Nov 10, 2025
@joe-replin joe-replin linked an issue Nov 10, 2025 that may be closed by this pull request
@joe-replin joe-replin changed the title New: Add offline xAPI statement queue with retry logic (fixes #5) New: PR#5 Add offline xAPI statement queue (fixes #5) Nov 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

offline storage for connection issues

2 participants