fix(queue): preserve durable records across retries - #740
Open
dustinbyrne wants to merge 1 commit into
Open
Conversation
5 tasks
Contributor
|
Reviews (1): Last reviewed commit: "fix(queue): preserve durable records acr..." | Re-trigger Greptile |
Contributor
posthog-android Compliance ReportDate: 2026-09-04 20:09:40 UTC ✅ All Tests Passed!46/46 tests passed Capture Tests✅ 29/29 tests passed View Details
Feature_Flags Tests✅ 17/17 tests passed View Details
|
dustinbyrne
force-pushed
the
fix/durable-queue-lifecycle
branch
from
September 4, 2026 20:03
e99dfe0 to
438a88a
Compare
dustinbyrne
marked this pull request as ready for review
September 4, 2026 20:17
Contributor
|
Reviews (2): Last reviewed commit: "fix(queue): preserve durable records acr..." | Re-trigger Greptile |
turnipdabeets
approved these changes
Sep 4, 2026
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.
💡 Motivation and Context
Durable event and replay queues currently couple retention to flush retry exhaustion: repeated retryable failures can clear every persisted record. Queue filenames also reuse payload UUIDs, so duplicate payload identities do not represent distinct durable entries.
This aligns the shared file-backed queue with PostHog/sdk-specs#53: retryable transport and HTTP failures retain bounded durable records, known-offline periods consume no attempts, and every enqueue has a stable queue-entry identity. HTTP 413 continues shrinking to a singleton poison record.
Cross-SDK implementation: PostHog/posthog-ios#788
💚 How did you test it?
./gradlew :posthog:test --tests 'com.posthog.internal.PostHogQueueTest'make testJavamake checkFormatmake api— no API snapshot changesgit diff --check📝 Checklist
If releasing new changes
pnpm changesetto generate a changeset file🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Implemented with Pi using isolated implementation, scout, and review subagents. The human directed the durability contract and cross-SDK scope. Queue capacity and bounded backoff remain the resource controls; no public option or default was added.