Repository navigation
Conversation
The library never expires a request. expiresAt on a descriptor and lifetimeMs in configure() stay in the types, deprecated and ignored: mutate() and configure() accept any value and warn once per client in development. configure() no longer sends lifetimeMs. Every enqueue sends expiresAt 8640000000000000, because native in 11.3.0 rejects an entry without one. errorKind 'expired' is deprecated; an outcome an earlier version journaled still reaches onError. README, CHANGELOG, the codegen spec comments, the fake native docs and the example app's expiry steps now describe no deadlines. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
JS sends every new or re-queued request with a fixed far-future deadline, so it cannot expire. A live entry that an earlier version queued keeps its stored deadline until the native side stops reading it, in the same release. An entry that already settled expired stays an error row. The README's seeding example now passes deliveries: 0, so the first delivery counts 1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Why
The top goal of the library is that every request started on the device reaches the server. A deadline works against that goal: it is a
cancel()that the library runs on a timer. The only app that uses the library sets a 10-year lifetime and queues again what expires. So the library drops deadlines. An app that needs a bound callscancel(id)itself.This PR is the JS side: the contract, the fake native module, the tests and the docs. Two other PRs remove expiry from Android and iOS. This PR must ship in the same release as those two.
What changes
expiresAtandlifetimeMsare deprecated and ignored. Both stay in the types for this release, so app code written for 11.3.0 compiles and runs with no change. They leave the types in the next major release.mutate()used to reject anexpiresAtthat was not finite, zero or negative, andconfigure()did the same forlifetimeMs. Now both accept any value. An ignored value must never be the reason a request is refused.mutate()whose descriptor setsexpiresAt, and the firstconfigure()that setslifetimeMs, warn one time per client. The warning goes toonWarning, or toconsole.warnwhen no sink is set. Production builds do not warn.configure()no longer sendslifetimeMs. Native on master never read it.expiresAt: 8640000000000000, the largest validDate, whatever the definition set. Native on master requires a number there: Android rejects with "descriptor.expiresAt is required" (EntryParsing.kt), and iOS with "missing 'expiresAt'" (EnqueueParser.swift). So every new or re-queued request cannot expire, with this PR alone or with the native PRs.expiredstays anerrorrow untilcancel()or a same-idmutate().errorKind: 'expired'is deprecated. New and re-queued requests never settleexpired. Anexpiredoutcome that JS did not acknowledge still reachesonErrorafter the upgrade, as before.expiredoutcome withbuildSettled(id, outcome, { deliveries: 0 })andseedUnacknowledged().## Unreleased) match. The example app keeps its "Expires in s" field to check that nothing expires; its Android step 9 and iOS step 13 now test that.Behavior change
expiresAtor aconfigure()lifetimeMsdoes nothing. Before, they set when a request settlederrorwitherrorKind: 'expired'.configure()sends one less key to native.expiresAtvalue sent to native now see the fixed value, and tests that run in development mode see the warning.What it does not change
expiresAt,lifetimeMsand'expired', so no app code has to change.expiresAt. It stays in the list of known descriptor fields, so a descriptor that sets it is accepted.test-vectors/does not change.Tests
Jest. The tests changed first and failed on master: 25 failures. They cover:
expiresAtaccepted with any value, and the fixed value sent.mutate()whateverexpiresAtit sets.lifetimeMsaccepted with any value and not forwarded.These tests pass on master too, by design: an old
expiredoutcome reachingonError(in delivery and through the fake), and the fake never expiring an entry.Type tests (
src/__typetests__/deadlines.ts). A descriptor withexpiresAtandconfigure()withlifetimeMscompile.ErrorKindstill has'expired', and an exhaustive switch over it compiles.Mutation checks. Each break below was made on purpose, and at least one check failed for each:
expiresAt,lifetimeMsor'expired'from the types (typecheck fails).expiredoutcomes in delivery.expiresAt. Send a 14-day deadline. ForwardlifetimeMsto native again.expiresAtorlifetimeMs.expiresAtwhen set. DropexpiresAtfrom the known descriptor fields.expiredoutcome.Local checks.
yarn testpasses (exit 0, 322 tests in 7 suites).yarn typecheckpasses (exit 0).yarn lint:cipasses (exit 0).Review
An independent review agent checked the fixed value against the native code on this branch (iOS by test, Android by reading) and found no code defect. On both platforms a different
expiresAtin a same-idmutate()only replaces the stored deadline; it never restarts an upload.🤖 Generated with Claude Code