refactor(mobile): reuse the cloud task engine#3624
Open
richardsolomou wants to merge 4 commits into
Open
Conversation
This was referenced Jul 21, 2026
|
React Doctor found no issues in the changed files. 🎉 Reviewed by React Doctor for commit |
richardsolomou
force-pushed
the
posthog-code/share-cloud-task-policies
branch
from
July 21, 2026 13:38
c05b44e to
dc82fa7
Compare
richardsolomou
force-pushed
the
posthog-code/share-cloud-task-engine
branch
from
July 21, 2026 13:46
2dafbcd to
1b48f46
Compare
richardsolomou
force-pushed
the
posthog-code/share-cloud-task-policies
branch
from
July 23, 2026 12:47
9e39cdd to
7936c58
Compare
richardsolomou
force-pushed
the
posthog-code/share-cloud-task-engine
branch
from
July 23, 2026 12:55
32895be to
54e687e
Compare
richardsolomou
force-pushed
the
posthog-code/share-cloud-task-policies
branch
from
July 23, 2026 13:35
7936c58 to
ac8c23a
Compare
richardsolomou
force-pushed
the
posthog-code/share-cloud-task-engine
branch
from
July 23, 2026 13:35
54e687e to
25563d8
Compare
This was referenced Jul 23, 2026
Member
Author
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
This was referenced Jul 23, 2026
richardsolomou
marked this pull request as ready for review
July 23, 2026 15:47
Contributor
Prompt To Fix All With AIFix the following 2 code review issues. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 2
packages/core/src/cloud-task/cloud-task-engine.ts:2165
**Archived fetch can hang hydration**
When a terminal run has no persisted session-log rows and its archive request stalls, this unbounded fetch never emits a snapshot or retryable error, leaving the mobile task session loading indefinitely.
### Issue 2 of 2
packages/core/src/cloud-task/cloud-task-engine.ts:2169-2170
**Malformed line discards entire archive**
When an archived NDJSON log contains one malformed line, parsing the complete array throws and returns `null`, causing hydration to reject every otherwise valid entry; the previous mobile parser skipped malformed lines and retained the remaining task history.
Reviews (1): Last reviewed commit: "fix(core): restore archived cloud task l..." | Re-trigger Greptile |
PR overviewAll previously flagged issues have been addressed. No open security concerns remain on this pull request. Security reviewNo open security issues remain on this pull request. Fixed/addressed: 1 · PR risk: 0/10 |
Generated-By: PostHog Code Task-Id: 40c57a59-b4e1-4760-8e56-ecd03e9c2f0f
Generated-By: PostHog Code Task-Id: c1bbe3cf-742b-4b24-bf96-d11a18b4cf22
Generated-By: PostHog Code Task-Id: c1bbe3cf-742b-4b24-bf96-d11a18b4cf22
Generated-By: PostHog Code Task-Id: c1bbe3cf-742b-4b24-bf96-d11a18b4cf22
richardsolomou
force-pushed
the
posthog-code/share-cloud-task-policies
branch
from
July 23, 2026 17:28
1155a8c to
afb4875
Compare
richardsolomou
force-pushed
the
posthog-code/share-cloud-task-engine
branch
from
July 23, 2026 17:28
bdfa389 to
5e38056
Compare
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.

Problem
Desktop and mobile independently implemented cloud-task streaming, hydration, retry, and deduplication behavior. Keeping both implementations makes parity fixes surface-specific.
Depends on #3623
Refs #2416
Changes
I extracted the existing desktop cloud-task implementation into a host-neutral engine and kept the desktop service as a thin wrapper. Mobile supplies host adapters to the same engine. Terminal runs retain the archived S3 log fallback when persisted session logs are empty.
Follow-up: #3608
How did you test this?
Automatic notifications
Created with PostHog Code