Repository navigation
Downloads: real failure codes on iOS, one start per download, ends after restart and text finishes reported - #785
Draft
posthog-eu[bot] wants to merge 1 commit into
Conversation
…rt and text finishes are reported - iOS DownloadError events send a reasonCode (network, disk full, HTTP status, cancelled). An HTTP error status fails the download instead of being saved as the model file. - JS failure paths keep the reason code of the error (the free-space check sends disk_full). - A queued placeholder row and its native id count as one start. - A download that ends after an app restart reports its end, once, without a duration. - A finished text download reports model_download_finished. - A failed storage write from a store change is logged, not an unhandled rejection. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Generated-By: PostHog Desktop Task-Id: eed443ce-b4a2-4988-811b-bedbdd221129
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
|
This branch has not been deployed
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.



Summary
Problem
DownloadErrorevents have noreasonCode, so most iOS failures reporterror_code: error.watchDownloadlistener runs before the global one and marks the row failed without the native code.disk_full, butstartModelDownload, Whisper and the image path drop the code.retryEntrywith the native id reports a second start. This doubles starts for text and speech models.model_download_finished: finalize removes the row without marking it complete. This is most of the low finish rate in the report.Changes
reasonCodeon bothDownloadErrorevents, with the same codes as AndroidDownloadReason(network_lost,network_timeout,disk_full,http_4xx,server_unavailable,user_cancelled, …).reasonCode, and failure paths pass known codes tosetStatus(newdownloadReasonCode()helper).retryEntryfrom aqueued:placeholder does not report a second start.reportEndreports only a change into the end status. A row from an earlier session reports its end from the row facts, withoutduration_ms. Auser_cancelledfrom before the restart is skipped, because iOS re-queues interrupted downloads that way.setCompletedbefore the row is removed, so the finish is reported.hydrationGatedStorage.setItemlogs a failed write. Callers that await the promise still get the rejection.error_code = errorshare of failuresmodel_download_startedcountmodel_download_finishedfor textduration_msWarning
User-visible: iOS rows now get a reason code, the same as Android. For codes that are not retryable (
disk_full,http_404, …), the Download Manager shows the code message and hides Retry. A 4xx/5xx response on iOS now fails the download and does not save the error page as the model.Type of Change
Screenshots / Screen Recordings
No layout change. The failed-row text and the Retry button follow the new codes (see the warning above). No device check was done.
Checklist
General
Testing
npm test)React Native Specific
project.pbxproj)SPACING/TYPOGRAPHYconstants from the themeuseThemedStylespattern (not inline or staticStyleSheet.create)FlatList/FlashList(not.map()insideScrollView)Performance & Models
/vs\\)Security
Related Issues
None.
Additional Notes
Tests
hydrationGatedStorage(no unhandled rejection; it fails without the fix),downloadErrors(downloadReasonCode),analyticsOwner(one start for a queued row, restored ends reported once; it fails without the fix), SwiftDownloadReasonCodeTests.@offgrid/*packages come from the private../sharedcheckout, which is not available here. I ran Jest with local stub packages. Across 248 download, store, hook, model and onboarding suites, the pass/fail results are identical before and after this change. The failures that remain come from the stubs.tscshows errors only for the missing packages. ESLint on the changed files shows no new problems.npm run test:ios), Android tests and device checks need macOS or a device. Not run.Agent context
Interrupted — app closedfailures for speech and image after a restart still have no code (error). They have noduration_ms, so a query can separate them.Created with PostHog Desktop from this inbox report.
🤖 Generated with Claude Code
Origin
signals-scout-first-report