-
Notifications
You must be signed in to change notification settings - Fork 212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CIS-835] Introduce channel freeze/unfreeze #1090
Conversation
18902f2
to
72f30e8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great 👍 Thank you
log.debug( | ||
"Making URL request: \(endpoint.method.rawValue.uppercased()) \(endpoint.path)\n" | ||
+ "Body:\n\(urlRequest.httpBody?.debugPrettyPrintedJSON ?? "<Empty>")\n" | ||
+ "Query items:\n\(urlRequest.queryItems.prettyPrinted)" | ||
) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice 😍
|
||
static func freezeChannel(_ freeze: Bool, cid: ChannelId) -> Endpoint<EmptyResponse> { | ||
.init( | ||
path: "channels/" + cid.apiPath, | ||
method: .patch, | ||
queryItems: nil, | ||
requiresConnectionId: false, | ||
body: ["set": ["frozen": freeze]] | ||
) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is actually a very nice and elegant workaround 👍
Codecov Report
@@ Coverage Diff @@
## main #1090 +/- ##
==========================================
- Coverage 91.71% 91.53% -0.18%
==========================================
Files 216 216
Lines 9145 9195 +50
==========================================
+ Hits 8387 8417 +30
- Misses 758 778 +20
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Sample output: --- 2021-05-19 17:29:32.126 [DEBUG] [NSManagedObjectContext 0x6000037095f0] [APIClient.swift:52] [request(endpoint:completion:)] > Making URL request: POST sync Body: { "last_sync_at" : "2021-05-19T15:28:20.066Z", "channel_cids" : [ "messaging:201BD2D3-E", .... //goes on ] } Query items: <Empty> --- or --- 2021-05-19 17:29:31.567 [DEBUG] [NSManagedObjectContext 0x60000370f740] [APIClient.swift:52] [request(endpoint:completion:)] > Making URL request: GET channels Body: <Empty> Query items: - payload={ "filter_conditions" : { "members" : { "$in" : [ "luke_skywalker" ] } }, "watch" : true, "message_limit" : 25, "limit" : 20 } - connection_id=60a253bc-0a05-2761-0000-00000039c862 ---
5c88449
to
bfba236
Compare
This is actually partial channel update, but we don't have the bandwidth to figure it out completely now. It's in our backlog and will be implemented fully soon.