[ECO-5577] Restore typed throws to PaginatedResult#359
[ECO-5577] Restore typed throws to PaginatedResult#359lawrence-forooghian merged 5 commits intomainfrom
PaginatedResult#359Conversation
335c7c9 to
1686337
Compare
WalkthroughThe PR updates toolchain and Xcode versions, disables code-coverage in CI, adjusts Xcode project/schemes, modifies example app code (including new Reaction fields and a small deletion-flow tweak), and introduces async/typed-throw pagination APIs with corresponding call-site updates. Most other changes are formatting (trailing commas) and config tweaks. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor App
participant ChatAPI
participant Backend as Backend/API
participant Pager as PaginatedResult<Item>
App->>ChatAPI: getMessages(params)
ChatAPI->>Backend: HTTP request (page 1)
Backend-->>ChatAPI: Response (items, pagination)
ChatAPI-->>App: Pager (async throws ARTErrorInfo)
App->>Pager: first()
Pager-->>App: PaginatedResult (page 1) or ARTErrorInfo
App->>Pager: next
Pager->>Backend: HTTP request (next page)
Backend-->>Pager: Response (items, pagination)
Pager-->>App: PaginatedResult (next) or ARTErrorInfo
note over App,Pager: Errors are now typed (ARTErrorInfo)
sequenceDiagram
autonumber
actor Client
participant Rooms as Rooms Registry
participant Factory as RoomFactory
participant Room as DefaultRoom
Client->>Rooms: getOrCreate(name, options)
alt existing pending
Client->>Rooms: await waitForRoom()
Rooms-->>Client: Room or throws InternalError
else not existing
Rooms->>Factory: createRoom(...)
Factory-->>Rooms: DefaultRoom (as Room)
Rooms-->>Client: Room
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
beea4a1 to
f7be60d
Compare
f7be60d to
ccc0ea8
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Jira integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (61)
.github/workflows/check.yaml(6 hunks).swift-version(1 hunks).swiftpm/xcode/xcshareddata/xcschemes/AblyChat-Package.xcscheme(1 hunks).swiftpm/xcode/xcshareddata/xcschemes/AblyChat.xcscheme(1 hunks).swiftpm/xcode/xcshareddata/xcschemes/BuildTool.xcscheme(1 hunks)Example/AblyChatExample.xcodeproj/project.pbxproj(5 hunks)Example/AblyChatExample/AblyChatExample.entitlements(1 hunks)Example/AblyChatExample/ContentView.swift(6 hunks)Example/AblyChatExample/MessageViews/MessageReactionSummaryView.swift(1 hunks)Example/AblyChatExample/MessageViews/MessageReactionsPicker.swift(1 hunks)Example/AblyChatExample/MessageViews/MessageReactionsSheet.swift(3 hunks)Example/AblyChatExample/MessageViews/MessageView.swift(2 hunks)Example/AblyChatExample/Mocks/Misc.swift(1 hunks)Example/AblyChatExample/Mocks/MockClients.swift(22 hunks)Example/AblyChatExample/Mocks/MockSubscriptionStorage.swift(7 hunks)Mintfile(1 hunks)Package.swift(3 hunks)README.md(1 hunks)Sources/AblyChat/.swiftformat(1 hunks)Sources/AblyChat/ChatAPI.swift(6 hunks)Sources/AblyChat/DefaultConnection.swift(1 hunks)Sources/AblyChat/DefaultMessageReactions.swift(4 hunks)Sources/AblyChat/DefaultMessages.swift(2 hunks)Sources/AblyChat/DefaultPresence.swift(2 hunks)Sources/AblyChat/DefaultRoomReactions.swift(3 hunks)Sources/AblyChat/DefaultTyping.swift(7 hunks)Sources/AblyChat/Errors.swift(1 hunks)Sources/AblyChat/JSONCodable.swift(2 hunks)Sources/AblyChat/Message.swift(5 hunks)Sources/AblyChat/Messages.swift(2 hunks)Sources/AblyChat/Occupancy.swift(1 hunks)Sources/AblyChat/PaginatedResult.swift(3 hunks)Sources/AblyChat/Room.swift(5 hunks)Sources/AblyChat/RoomLifecycleManager.swift(7 hunks)Sources/AblyChat/Rooms.swift(7 hunks)Sources/AblyChat/Subscription.swift(1 hunks)Sources/AblyChat/TypingOperationQueue.swift(1 hunks)Sources/BuildTool/BuildTool.swift(15 hunks)Sources/BuildTool/DestinationFetcher.swift(1 hunks)Tests/AblyChatTests/ChatAPITests.swift(8 hunks)Tests/AblyChatTests/DefaultChatClientTests.swift(4 hunks)Tests/AblyChatTests/DefaultInternalLoggerTests.swift(2 hunks)Tests/AblyChatTests/DefaultMessageReactionsTests.swift(11 hunks)Tests/AblyChatTests/DefaultMessagesTests.swift(23 hunks)Tests/AblyChatTests/DefaultPresenceTests.swift(27 hunks)Tests/AblyChatTests/DefaultRoomLifecycleManagerTests.swift(34 hunks)Tests/AblyChatTests/DefaultRoomOccupancyTests.swift(5 hunks)Tests/AblyChatTests/DefaultRoomReactionsTests.swift(5 hunks)Tests/AblyChatTests/DefaultRoomTests.swift(4 hunks)Tests/AblyChatTests/DefaultTypingTests.swift(4 hunks)Tests/AblyChatTests/Helpers/Sandbox.swift(1 hunks)Tests/AblyChatTests/IntegrationTests.swift(7 hunks)Tests/AblyChatTests/InternalErrorTests.swift(1 hunks)Tests/AblyChatTests/Mocks/MockHTTPPaginatedResponse.swift(5 hunks)Tests/AblyChatTests/Mocks/MockRealtime.swift(2 hunks)Tests/AblyChatTests/Mocks/MockRealtimeChannel.swift(1 hunks)Tests/AblyChatTests/Mocks/MockRealtimePresence.swift(1 hunks)Tests/AblyChatTests/Mocks/MockRoomLifecycleManager.swift(1 hunks)Tests/AblyChatTests/Mocks/MockSuppliedRealtime.swift(1 hunks)Tests/AblyChatTests/RoomReactionDTOTests.swift(2 hunks)Tests/AblyChatTests/TypingTimerManagerTests.swift(6 hunks)
🧰 Additional context used
🧬 Code graph analysis (17)
Tests/AblyChatTests/DefaultRoomReactionsTests.swift (1)
Tests/AblyChatTests/DefaultMessagesTests.swift (1)
generateMessage(490-504)
Tests/AblyChatTests/DefaultRoomLifecycleManagerTests.swift (1)
Sources/AblyChat/RoomLifecycleManager.swift (1)
createManager(41-50)
Tests/AblyChatTests/DefaultInternalLoggerTests.swift (4)
Sources/AblyChat/Logging.swift (3)
log(51-54)log(79-86)log(93-100)Tests/AblyChatTests/Helpers/TestLogger.swift (1)
log(9-15)Tests/AblyChatTests/Mocks/MockInternalLogger.swift (1)
log(6-8)Tests/AblyChatTests/Mocks/MockLogHandler.swift (1)
log(6-8)
Tests/AblyChatTests/Mocks/MockRealtimePresence.swift (1)
Tests/AblyChatTests/Helpers/Helpers.swift (1)
addRecord(146-150)
Tests/AblyChatTests/DefaultMessagesTests.swift (2)
Tests/AblyChatTests/Mocks/MockRealtimeChannel.swift (1)
emitEvent(190-194)Tests/AblyChatTests/Helpers/Helpers.swift (1)
hasRecord(152-163)
Tests/AblyChatTests/TypingTimerManagerTests.swift (1)
Tests/AblyChatTests/DefaultTypingTests.swift (14)
iOS(9-25)iOS(28-41)iOS(48-67)iOS(70-81)iOS(85-107)iOS(110-132)iOS(135-154)iOS(157-170)iOS(174-189)iOS(192-207)iOS(211-223)iOS(226-244)iOS(247-264)iOS(268-292)
Example/AblyChatExample/Mocks/MockSubscriptionStorage.swift (3)
Sources/AblyChat/Subscription.swift (2)
unsubscribe(60-62)unsubscribe(87-89)Tests/AblyChatTests/Mocks/MockRealtimeChannel.swift (1)
unsubscribe(159-161)Sources/AblyChat/AblyCocoaExtensions/InternalAblyCocoaTypes.swift (3)
unsubscribe(279-281)unsubscribe(395-397)unsubscribe(431-433)
Sources/AblyChat/Occupancy.swift (1)
Sources/AblyChat/JSONCodable.swift (1)
numberValueForKey(166-176)
Sources/AblyChat/Rooms.swift (4)
Example/AblyChatExample/Mocks/MockClients.swift (5)
get(26-33)get(382-384)get(437-446)get(448-457)get(565-567)Sources/AblyChat/DefaultPresence.swift (2)
get(20-43)get(45-68)Tests/AblyChatTests/Mocks/MockRealtimeChannel.swift (1)
get(79-86)Tests/AblyChatTests/Mocks/MockRealtimePresence.swift (2)
get(23-29)get(31-37)
Tests/AblyChatTests/Mocks/MockRoomLifecycleManager.swift (1)
Tests/AblyChatTests/DefaultRoomTests.swift (4)
arguments(64-88)arguments(91-116)arguments(136-168)arguments(172-204)
Sources/AblyChat/Message.swift (1)
Sources/AblyChat/JSONCodable.swift (1)
optionalObjectValueForKey(73-87)
Sources/AblyChat/Messages.swift (2)
Example/AblyChatExample/Mocks/MockSubscriptionStorage.swift (1)
historyBeforeSubscribe(211-213)Sources/AblyChat/Subscription.swift (1)
historyBeforeSubscribe(91-106)
Sources/AblyChat/ChatAPI.swift (4)
Sources/AblyChat/Messages.swift (1)
asQueryItems(270-298)Tests/AblyChatTests/Mocks/MockRealtime.swift (1)
request(33-53)Sources/AblyChat/AblyCocoaExtensions/InternalAblyCocoaTypes.swift (1)
request(148-169)Sources/AblyChat/PaginatedResult.swift (1)
toPaginatedResult(109-111)
Tests/AblyChatTests/DefaultPresenceTests.swift (3)
Sources/AblyChat/DefaultPresence.swift (3)
update(129-131)update(133-135)update(138-159)Tests/AblyChatTests/Mocks/MockRealtimePresence.swift (1)
update(53-58)Tests/AblyChatTests/Helpers/Helpers.swift (1)
hasRecord(152-163)
Sources/BuildTool/BuildTool.swift (1)
Sources/BuildTool/ProcessRunner.swift (1)
run(9-33)
Example/AblyChatExample/Mocks/MockClients.swift (1)
Sources/AblyChat/SubscriptionStorage.swift (2)
emit(37-41)emit(78-82)
Sources/AblyChat/PaginatedResult.swift (2)
Example/AblyChatExample/Mocks/MockClients.swift (1)
current(569-571)Sources/AblyChat/DefaultOccupancy.swift (1)
current(71-79)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
- GitHub Check: Example app, macOS (Xcode 26.0)
- GitHub Check: Xcode, iOS (Xcode 26.0)
- GitHub Check: Xcode, tvOS (Xcode 26.0)
- GitHub Check: Xcode, macOS (Xcode 26.0)
- GitHub Check: Xcode,
releaseconfiguration, iOS (Xcode 26.0) - GitHub Check: Example app, iOS (Xcode 26.0)
- GitHub Check: Xcode,
releaseconfiguration, tvOS (Xcode 26.0) - GitHub Check: Example app, tvOS (Xcode 26.0)
- GitHub Check: SPM (Xcode 26.0)
- GitHub Check: Xcode,
releaseconfiguration, macOS (Xcode 26.0)
🔇 Additional comments (30)
Tests/AblyChatTests/DefaultInternalLoggerTests.swift (1)
20-24: Trailing commas are fine.All the added trailing commas are valid Swift style and don’t change runtime behavior. 👍
Also applies to: 37-41, 43-47
Tests/AblyChatTests/DefaultRoomTests.swift (4)
68-68: LGTM! Formatting improvement with trailing commas.Adding trailing commas in test argument arrays improves consistency and reduces future diff noise when adding test cases.
Also applies to: 72-72, 74-74
96-96: LGTM! Formatting improvement with trailing commas.The trailing commas align with Swift style conventions and make future edits cleaner.
Also applies to: 100-100, 102-102
140-140: LGTM! Formatting improvement with trailing commas.Consistent trailing comma formatting applied to test arguments.
176-176: LGTM! Formatting improvement with trailing commas.The trailing comma maintains consistency with other test argument blocks in this file.
Example/AblyChatExample/MessageViews/MessageReactionSummaryView.swift (1)
58-62: LGTM!The trailing comma addition is a formatting improvement that aligns with Swift conventions and enhances code consistency.
Example/AblyChatExample/MessageViews/MessageReactionsPicker.swift (1)
53-56: LGTM!The trailing comma additions in the iOS and macOS background blocks are formatting improvements that align with Swift conventions.
Also applies to: 58-61
Example/AblyChatExample/MessageViews/MessageView.swift (2)
36-44: LGTM!The trailing comma additions in the initializer and modifier calls are formatting improvements that align with Swift conventions.
Also applies to: 50-60
61-64: LGTM!Resetting
isDeleteConfirmationPresentedafter deletion ensures the confirmation dialog state is properly cleared, preventing potential UI state issues.Example/AblyChatExample/MessageViews/MessageReactionsSheet.swift (1)
24-28: LGTM!The trailing comma additions in the initializer and modifier blocks are formatting improvements that align with Swift conventions.
Also applies to: 79-82, 84-87, 102-105, 107-110
Example/AblyChatExample/ContentView.swift (2)
19-22: LGTM!The trailing comma additions in initializers and list operations are formatting improvements that align with Swift conventions.
Also applies to: 261-269, 273-278, 308-313, 326-333
452-462: LGTM!The addition of
rotationAngleandrotationSpeedproperties to theReactionstruct, along with their initialization and usage in the animation logic, is a coherent enhancement that adds rotation animation capabilities to reactions. The implementation is consistent and well-integrated.Also applies to: 464-509
Sources/BuildTool/BuildTool.swift (2)
20-20: LGTM! Consistent trailing comma formatting.The addition of trailing commas throughout the file is a good Swift style practice that reduces diff noise when modifying collections and parameter lists.
Also applies to: 27-27, 45-45, 62-62, 79-79, 95-95, 133-133, 218-218, 272-272, 487-487, 490-490, 534-534, 546-546, 557-557, 565-565, 777-777, 796-796, 823-823
137-137: Xcode 26.0 is a valid release as of October 2025.Sources/AblyChat/DefaultPresence.swift (1)
255-256: LGTM: Formatting change.Trailing comma added for consistency.
Sources/AblyChat/Errors.swift (1)
329-329: LGTM: Formatting change.Trailing comma added for consistency.
.swiftpm/xcode/xcshareddata/xcschemes/BuildTool.xcscheme (1)
3-3: LGTM: Xcode version upgrade.Updated to target Xcode 26.0, consistent with PR objective to require Xcode 26+.
.swiftpm/xcode/xcshareddata/xcschemes/AblyChat.xcscheme (1)
3-3: LGTM: Xcode version upgrade.Updated to target Xcode 26.0, consistent with PR objective.
Sources/AblyChat/TypingOperationQueue.swift (1)
21-21: LGTM: Formatting change.Trailing comma added for consistency.
.swiftpm/xcode/xcshareddata/xcschemes/AblyChat-Package.xcscheme (1)
3-3: LGTM: Xcode version upgrade.Updated to target Xcode 26.0, consistent with PR objective.
Example/AblyChatExample/AblyChatExample.entitlements (1)
4-4: Verify removal of app sandbox entitlements.All sandbox and network entitlements have been removed. Ensure this change is intentional and does not introduce security risks or violate any distribution requirements for the example app. If this is purely for local development/testing convenience, consider documenting the rationale.
.swift-version (1)
1-1: LGTM: Swift toolchain upgrade.Updated to Swift 6.2, which ships with Xcode 26.0 and supports the typed throws features this PR aims to restore.
Sources/AblyChat/RoomLifecycleManager.swift (1)
34-34: LGTM! Formatting improvements with trailing commas.The trailing commas added to function signatures and initializers improve code maintainability by reducing diff noise when parameters are added or reordered. No behavioral changes detected.
Also applies to: 43-43, 48-48, 116-116, 124-124, 135-135, 143-143, 154-154, 307-307, 352-352
Tests/AblyChatTests/InternalErrorTests.swift (1)
16-16: LGTM! Test naming improvement.Removing the "test" prefix aligns with Swift Testing conventions where the
@Testattribute already identifies the function as a test.Sources/AblyChat/Occupancy.swift (1)
114-114: LGTM! Formatting improvement with trailing comma.Consistent with Swift style conventions for improved diff readability.
Tests/AblyChatTests/ChatAPITests.swift (1)
29-29: LGTM! Formatting improvements with trailing commas.Trailing commas added to test initializers and dictionaries improve maintainability with no behavioral changes.
Also applies to: 55-55, 74-75, 97-98, 120-120, 151-151, 161-162, 163-163, 191-191
Tests/AblyChatTests/DefaultMessagesTests.swift (1)
31-31: LGTM! Comprehensive formatting improvements.Trailing commas added consistently throughout test initializers, mock configurations, and assertions. No behavioral changes to test logic.
Also applies to: 50-51, 76-76, 99-100, 124-124, 145-146, 231-231, 240-241, 256-256, 267-268, 283-283, 293-294, 297-297, 301-301, 309-310, 325-325, 335-336, 340-340, 348-349, 365-365, 403-403, 434-434, 463-463, 509-509, 512-512, 534-534, 553-553, 571-571, 603-603
Tests/AblyChatTests/Mocks/MockRealtime.swift (1)
25-25: LGTM! Formatting improvements in mock.Trailing commas added to initializer and method call for consistency with codebase style.
Also applies to: 47-47
Tests/AblyChatTests/DefaultChatClientTests.swift (1)
12-12: LGTM! Formatting improvements in test setup.Trailing commas added to mock factory initializers for consistency.
Also applies to: 28-28, 44-44, 62-62
Tests/AblyChatTests/Mocks/MockRealtimePresence.swift (1)
26-26: LGTM! Formatting improvements in mock recording.Trailing commas added to call recorder arguments for consistency.
Also applies to: 34-34, 42-42, 49-49, 56-56
PaginatedResultPaginatedResult
This PR changes the SDK to require Xcode 26 and above, which allows us to revert the public API workaround of 10d8f79.
Resolves #267.
Summary by CodeRabbit