Skip to content

feat: improve event delivery reliability for tracked events - #253

Open
fabriziodemaria wants to merge 3 commits into
mainfrom
feat/event-flush-reliability
Open

feat: improve event delivery reliability for tracked events#253
fabriziodemaria wants to merge 3 commits into
mainfrom
feat/event-flush-reliability

Conversation

@fabriziodemaria

Copy link
Copy Markdown
Member

Summary

  • Upload pending .ready batches at engine startup (retries events from prior sessions without sealing the current file)
  • Flush and upload the current batch in EventSenderEngine.stop() before tearing down (called from Confidence.stop())
  • Add optional eventFlushIntervalMillis to ConfidenceFactory.create() for periodic flush (disabled by default)
  • Call confidence.flush() from provider shutdown() as a best-effort lifecycle hook

Test plan

  • ./gradlew :Confidence:testDebugUnitTest --tests EventSenderEngineReliabilityTest
  • Verify startup uploads only pending batches and leaves the current file intact
  • Verify stop() uploads in-flight events
  • Verify periodic interval triggers upload when configured

Made with Cursor

Upload pending batches at startup, flush and upload on stop(), and add an optional periodic flush interval so low-volume events are not left on disk indefinitely.
Do not assign the companion Instance field; main never cached instances and
tests rely on a fresh engine per ConfidenceFactory.create() call.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant