optimizely / optimizely/swift-sdk

[ENHANCEMENT] Async-await start to return result

Open
#553 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

acknowledged enhancement
Dominant language
Swift
Stars
24
Forks
39
Avg merge
13h 3m
Merged PRs (30d)
2

Description

Description

Currently the async-await start implementation is a wrapper for the asynchronous completion handler start function. It resumes when the data file is downloaded, but discards the file data.
A simple change would be to make start return Data and replace

case .success:
    continuation.resume()

with

case .success(let datafile):
    continuation.resume(returning: datafile)
Benefits

This will simplify SDK usage in modern Swift code

Detail

No response

Examples

No response

Risks/Downsides

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Search the async-await start implementation and its asynchronous completion-handler start function. Update the success path so the async-await start returns the downloaded Data, then verify that callers receive the file data instead of only waiting for completion.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
api
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.