Repository navigation
Mobile Realtime Sync Research #627
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
155b6b2
854c1f1
ad07907
d77adf6
041a867
a424622
79f6ed9
2fd2072
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -435,6 +435,9 @@ function parseListLanesArgs(value: Record<string, unknown>): ListLanesArgs { | |
| return { | ||
| includeArchived: asOptionalBoolean(value.includeArchived), | ||
| includeStatus: asOptionalBoolean(value.includeStatus), | ||
| includeConflictStatus: asOptionalBoolean(value.includeConflictStatus), | ||
| includeRebaseSuggestions: asOptionalBoolean(value.includeRebaseSuggestions), | ||
| includeAutoRebaseStatus: asOptionalBoolean(value.includeAutoRebaseStatus), | ||
| }; | ||
| } | ||
|
|
||
|
|
@@ -1866,13 +1869,20 @@ function summarizeLaneRuntime( | |
| async function buildLaneListSnapshots( | ||
| args: SyncRemoteCommandServiceArgs, | ||
| lanes: Awaited<ReturnType<ReturnType<typeof createLaneService>["list"]>>, | ||
| options: ListLanesArgs = {}, | ||
| ): Promise<LaneListSnapshot[]> { | ||
| const [sessions, rebaseSuggestions, autoRebaseStatuses, stateSnapshots, batchAssessment] = await Promise.all([ | ||
| Promise.resolve(args.sessionService.list({ limit: 500 })), | ||
| Promise.resolve(args.rebaseSuggestionService?.listSuggestions() ?? []), | ||
| Promise.resolve(args.autoRebaseService?.listStatuses() ?? []), | ||
| options.includeRebaseSuggestions === false | ||
| ? Promise.resolve([]) | ||
| : Promise.resolve(args.rebaseSuggestionService?.listSuggestions({ lanes }) ?? []), | ||
| options.includeAutoRebaseStatus === false | ||
| ? Promise.resolve([]) | ||
| : Promise.resolve(args.autoRebaseService?.listStatuses({ lanes }) ?? []), | ||
| Promise.resolve(args.laneService.listStateSnapshots()), | ||
| args.conflictService?.getBatchAssessment({ lanes }).catch(() => null) ?? Promise.resolve(null), | ||
| options.includeConflictStatus === false | ||
| ? Promise.resolve(null) | ||
| : args.conflictService?.getBatchAssessment({ lanes }).catch(() => null) ?? Promise.resolve(null), | ||
| ]); | ||
|
|
||
| const rebaseByLaneId = new Map(rebaseSuggestions.map((entry) => [entry.laneId, entry] as const)); | ||
|
|
@@ -1892,7 +1902,7 @@ async function buildLaneListSnapshots( | |
| } | ||
|
|
||
| async function buildLaneDetailPayload(args: SyncRemoteCommandServiceArgs, laneId: string): Promise<LaneDetailPayload> { | ||
| const lane = (await args.laneService.list({ includeArchived: true, includeStatus: true })).find((entry) => entry.id === laneId) ?? null; | ||
| const lane = await args.laneService.getSummary(laneId, { includeStatus: true }); | ||
| if (!lane) throw new Error(`Lane not found: ${laneId}`); | ||
|
|
||
| const [ | ||
|
|
@@ -1916,8 +1926,8 @@ async function buildLaneDetailPayload(args: SyncRemoteCommandServiceArgs, laneId | |
| args.laneService.getChildren(laneId), | ||
| Promise.resolve(args.sessionService.list({ laneId, limit: 200 })), | ||
| args.agentChatService?.listSessions(laneId, { includeAutomation: true }) ?? Promise.resolve([]), | ||
| Promise.resolve(args.rebaseSuggestionService?.listSuggestions() ?? []), | ||
| Promise.resolve(args.autoRebaseService?.listStatuses() ?? []), | ||
| Promise.resolve(args.rebaseSuggestionService?.listSuggestions({ lanes: [lane] }) ?? []), | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
For stacked child lanes, Useful? React with 👍 / 👎. |
||
| Promise.resolve(args.autoRebaseService?.listStatuses({ lanes: [lane] }) ?? []), | ||
| Promise.resolve(args.laneService.getStateSnapshot(laneId)), | ||
| args.gitService?.listRecentCommits({ laneId, limit: 20 }) ?? Promise.resolve([]), | ||
| args.diffService?.getChanges(laneId).catch(() => null) ?? Promise.resolve(null), | ||
|
|
@@ -1965,10 +1975,11 @@ type RemoteCommandRegistrationDeps = { | |
| function registerLaneRemoteCommands({ args, register }: RemoteCommandRegistrationDeps): void { | ||
| register("lanes.list", { viewerAllowed: true }, async (payload) => args.laneService.list(parseListLanesArgs(payload))); | ||
| register("lanes.refreshSnapshots", { viewerAllowed: true }, async (payload) => { | ||
| const refreshed = await args.laneService.refreshSnapshots(parseListLanesArgs(payload)); | ||
| const listArgs = parseListLanesArgs(payload); | ||
| const refreshed = await args.laneService.refreshSnapshots(listArgs); | ||
| return { | ||
| ...refreshed, | ||
| snapshots: await buildLaneListSnapshots(args, refreshed.lanes), | ||
| snapshots: await buildLaneListSnapshots(args, refreshed.lanes, listArgs), | ||
| }; | ||
| }); | ||
| register("lanes.getDetail", { viewerAllowed: true }, async (payload) => | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When a peer has an outstanding
pendingChangesetBatch, this new earlycontinueruns before the existing ACK timeout/retry block below. For an active chat subscription whose WebSocket buffer stays above 512 KiB, a lost changeset ACK leaves that pending batch stuck indefinitely and blocks all later DB changes for that peer until chat traffic drains; the timeout/close path is bypassed. Consider handlingpeer.pendingChangesetBatchbefore deferring only new background batches.Useful? React with 👍 / 👎.