Repository navigation
[FSSDK-13302] fix: forward options in async fetchQualifiedSegments - #667
Conversation
The async overload called the completion-handler form without passing `options`, so .ignoreCache and .resetCache were silently ignored. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The ticket reference in the title (FSSDK-13227) pointed at an unrelated, already-closed docs ticket. Created FSSDK-13302 for this bug and updated the PR title accordingly. |
Matjaz Pirnovar (Mat001)
left a comment
There was a problem hiding this comment.
Fixes a real bug — the async fetchQualifiedSegments(options:) was dropping options, so .ignoreCache / .resetCache were silently ignored. One-line fix forwards them.
Complete, not partial — I checked every other async overload (decideAsync, decideAllAsync); they all already forward options correctly, so this was the only broken one.
Matches the existing sync overload, removing a genuine asymmetry.
Has a real regression test that drives the actual fixed path and would have failed before the change.
Low risk — tightly scoped, two-way door (one-line revert), no behavior change for callers who pass no options.
b3230ed
into
master
Summary
The
asyncoverload offetchQualifiedSegments(options:)droppedoptionswhen delegating to the completion-handler form, so.ignoreCache/.resetCachewere silently ignored. The sync overload already forwards them.public func fetchQualifiedSegments(options: [OptimizelySegmentOption] = []) async throws { return try await withCheckedThrowingContinuation { continuation in - fetchQualifiedSegments { error in + fetchQualifiedSegments(options: options) { error inFound while verifying the Swift SDK 6.0.0 docs (optimizely/feature-experimentation-docs#33), which now carry a warning about this until the fix ships.
Evidence
New test
OptimizelyUserContextTests_ODP_Aync_Await.testFetchQualifiedSegments_optionsForwarded:XCTAssertEqual failed: ("Optional([..., ...])") is not equal to ("Optional([])")— 6 tests, 1 failureAfter:
Executed 6 tests, with 0 failures(OptimizelyTests-APIs-iOS, iPhone 17 Pro simulator)Merge Danger
Door: two-way — one-line revert.
Blast Radius: Only callers of the
asyncoverload that pass non-emptyoptions. They will now get the cache behavior they asked for (e.g..ignoreCachetriggers a network fetch instead of a cache hit). Calls without options are unchanged.Issues
🤖 Generated with Claude Code