You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is based on [1] at aa7455d. It’s generated some questions, which
I’ve asked on that PR.
I started implementing this as part of #19, before realising that
implementing the spec is not the aim of that task. So, putting this work
on hold until we pick it up again in #28.
So far, only the ATTACH operation is implemented.
[1] ably/specification#200
I have since updated with error names @ bcb7390
other stuff done since first version of this commit:
- start implementing the low-hanging fruit of DETACH
all the infrastructure in place for feature-specific errors
used generic type for contributor so that i can access the mock-specific
properties of the contributor's channel in the tests without having to
create channels and then create contributors from those
wip detachment errors
further with detachment errors
wip trying to see if there aren't 2 status updates
Revert "wip trying to see if there aren't 2 status updates"
This reverts commit 63dd9b9.
Doesn’t work.
implement CHA-RL2h2
wip channel detach retry
a few updates to older bits
implement more of RELEASE
comment
wip
done RELEASE
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -28,6 +28,7 @@ To check formatting and code quality, run `swift run BuildTool lint`. Run with `
28
28
- We should aim to make it easy for consumers of the SDK to be able to mock out the SDK in the tests for their own code. A couple of things that will aid with this:
29
29
- Describe the SDK’s functionality via protocols (when doing so would still be sufficiently idiomatic to Swift).
30
30
- When defining a `struct` that is emitted by the public API of the library, make sure to define a public memberwise initializer so that users can create one to be emitted by their mocks. (There is no way to make Swift’s autogenerated memberwise initializer public, so you will need to write one yourself. In Xcode, you can do this by clicking at the start of the type declaration and doing Editor → Refactor → Generate Memberwise Initializer.)
31
+
- TODO something about adding spec points in code and tests
This type exists in addition to ``ErrorCode`` to allow us to attach metadata which can be incorporated into the error’s `localizedDescription`.
46
+
This type exists in addition to ``ErrorCode`` to allow us to attach metadata which can be incorporated into the error’s `localizedDescription` and `cause`.
33
47
*/
34
48
internalenumChatError{
35
49
case inconsistentRoomOptions(requested:RoomOptions, existing:RoomOptions)
50
+
case channelAttachResultedInSuspended(underlyingError:ARTErrorInfo)
51
+
case channelAttachResultedInFailed(underlyingError:ARTErrorInfo)
52
+
case roomInFailedState
53
+
case roomIsReleasing
54
+
case roomIsReleased
55
+
case detachmentFailed(feature:RoomFeature, underlyingError:ARTErrorInfo)
36
56
37
57
/// The ``ARTErrorInfo.code`` that should be returned for this error.
"Rooms.get(roomID:options:) was called with a different set of room options than was used on a previous call. You must first release the existing room instance using Rooms.release(roomID:). Requested options: \(requested), existing options: \(existing)"
93
+
case.channelAttachResultedInSuspended:
94
+
"TODO"
95
+
case.channelAttachResultedInFailed:
96
+
"TODO"
97
+
case.roomInFailedState:
98
+
"Cannot perform operation because the room is in a failed state."
99
+
case.roomIsReleasing:
100
+
"Cannot perform operation because the room is in a releasing state."
101
+
case.roomIsReleased:
102
+
"Cannot perform operation because the room is in a released state."
103
+
caselet.detachmentFailed(feature, _):
104
+
{
105
+
letdescription=switch feature {
106
+
case.messages:
107
+
"messages"
108
+
case.occupancy:
109
+
"occupancy"
110
+
case.presence:
111
+
"presence"
112
+
case.reactions:
113
+
"reactions"
114
+
case.typing:
115
+
"typing"
116
+
}
117
+
return"The \(description) feature failed to detach."
118
+
}()
119
+
}
120
+
}
121
+
122
+
/// The ``ARTErrorInfo.cause`` that should be returned for this error.
// TODO: This is kind of an implementation detail (that NSUnderlyingErrorKey is what populates `cause`); consider documenting in ably-cocoa as part of https://github.com/ably-labs/ably-chat-swift/issues/32.
0 commit comments