microsoft / microsoft/SwiftStreamingMarkdown
Make MarkdownController and StreamedMarkdownController lifecycle methods async
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 364
- Forks
- 51
- PR merge metrics
- No merged PRs in 30d
Description
Summary
The lifecycle methods on MarkdownController and StreamedMarkdownController are currently synchronous, even though every call site invokes them from an async context (.task { ... }) or a place where a Task { } wrapper is already implied.
Marking them async lets the call sites await them directly, aligns the controllers with the package's Swift-concurrency conventions (AGENTS.md), and keeps the async boundary explicit at the view layer.
Methods to convert:
StreamedMarkdownController.start()/end()MarkdownController.onAppear(markdown:)/onDisappear()
The fire-and-forget interaction hooks (onTableCopyTap, onImageTap, etc.) and the sync onChange(markdown:) yield-into-continuation method are intentionally left synchronous, since their call sites are non-async UIKit/AppKit delegates and SwiftUI action closures.
Motivation
- Call sites already run inside
.task { }(an async context), soawait-ing is natural and avoids implicit fire-and-forget. - Makes the concurrency boundary explicit and consistent across the two controllers.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Locate MarkdownController and StreamedMarkdownController, then trace their start, end, onAppear(markdown:), and onDisappear() call sites, especially those inside .task closures. Make the four lifecycle methods async and update their async callers to await them; leave the interaction hooks and onChange(markdown:) synchronous.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ios, macos, swift
- Domain
- desktop-dev, mobile-dev
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 76/100