Skip to content

Fix composer timeline drift across conversation updates - #147

Merged
torlando-tech merged 5 commits into
mainfrom
fix/ios-composer-timeline-drift-pr
Aug 5, 2026
Merged

Fix composer timeline drift across conversation updates#147
torlando-tech merged 5 commits into
mainfrom
fix/ios-composer-timeline-drift-pr

Conversation

@torlando-tech

Copy link
Copy Markdown
Owner

Summary

When the composer updates its conversation after sending, the timeline could reload an unchanged collection, restore viewport state owned by the previous conversation, or leave loading state attached to a superseded request. This caused visible timeline drift and incorrect positioning.

This change:

  • skips reloads when the timeline identity is unchanged while refreshing pagination callbacks;
  • resets viewport and loading ownership when the conversation changes;
  • rejects completion from an older conversation load;
  • keeps the new conversation positioned at the bottom.

Verification

  • TDD red/green coverage for no-op updates, conversation transitions, stale load completion, and callback refresh
  • Focused iOS tests: 3 passed, 0 failed
  • Timeline policy group: 16 passed, 0 failed
  • Full iOS app suite: 239 passed, 0 failed
  • Static CI contract suite: 92 passed, 0 failed
  • The behavior-identical source patch previously passed physical device build, signing, installation, launch, and hands-on acceptance
  • Rebased five-commit stack is patch-identical to the accepted source and changes only the two messaging views plus their timeline tests

Risk and rollback

Risk is limited to message timeline reload and conversation-transition state. The regression suite covers unchanged updates, callback replacement, transition positioning, and stale async completion. Rollback is a revert of this five-commit stack.

@greptile-apps

greptile-apps Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR prevents timeline drift when SwiftUI updates or replaces a conversation.

  • Avoids collection reloads when messages and text scale are unchanged while retaining refreshed pagination callbacks.
  • Resets viewport and pagination ownership when the conversation identity changes.
  • Cancels superseded history loads and prevents their completions from modifying replacement-conversation state.
  • Adds focused tests for stable updates, conversation transitions, stale completion, and callback refresh.

Confidence Score: 5/5

The PR appears safe to merge with no concrete changed-code failure identified.

Conversation identity now scopes viewport and pagination ownership, unchanged rendering inputs avoid disruptive reloads, callbacks remain refreshed, and cancelled history tasks cannot overwrite replacement-conversation controller state.

Important Files Changed

Filename Overview
Sources/ColumbaApp/Views/Messaging/MessageTimelineView.swift Adds conversation-scoped timeline ownership, no-op rendering updates, stale pagination cancellation, viewport reset behavior, and testing accessors without an accepted defect.
Sources/ColumbaApp/Views/Messaging/MessagingView.swift Supplies the conversation identity to the timeline so reused controller state can be scoped correctly.
Tests/ColumbaAppTests/MessageBubbleLayoutTests.swift Adds focused regression coverage for viewport preservation, transition positioning, stale asynchronous completion, and callback replacement.

Sequence Diagram

sequenceDiagram
    participant SwiftUI as MessagingView
    participant Timeline as MessageTimelineViewController
    participant Load as Pagination Task
    SwiftUI->>Timeline: update(conversationID, messages, loading state)
    alt Same identity and rendering inputs
        Timeline->>Timeline: Refresh loading state and pagination policy
        Note over Timeline: Preserve collection and viewport
    else Conversation changed
        Timeline->>Load: Cancel superseded load
        Timeline->>Timeline: Reset viewport and loading ownership
        Timeline->>Timeline: Reload new messages
        Timeline->>Timeline: Position new timeline at bottom
    end
    Load-->>Timeline: Older callback eventually returns
    Timeline->>Timeline: Reject completion when cancelled
Loading

Reviews (1): Last reviewed commit: "fix: correct timeline loading state rese..." | Re-trigger Greptile

@torlando-tech
torlando-tech merged commit 9aadffa into main Aug 5, 2026
6 of 7 checks passed
@torlando-tech
torlando-tech deleted the fix/ios-composer-timeline-drift-pr branch August 5, 2026 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant