Skip to content
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

Fix new created channels miss initial values #945

Merged
merged 2 commits into from
Mar 31, 2021

Conversation

b-onc
Copy link
Contributor

@b-onc b-onc commented Mar 31, 2021

well.. I hope the comments clarify the issue enough, for our future selves' sake

@b-onc b-onc added 🐞 Bug An issue or PR related to a bug 🌐 SDK: StreamChat (LLC) Tasks related to the StreamChat LLC SDK labels Mar 31, 2021
@b-onc b-onc requested a review from VojtaStavik March 31, 2021 13:35
@codecov
Copy link

codecov bot commented Mar 31, 2021

Codecov Report

Merging #945 (3fe1c63) into main (e77403f) will increase coverage by 0.02%.
The diff coverage is 100.00%.

❗ Current head 3fe1c63 differs from pull request most recent head 8bbfd18. Consider uploading reports for the commit 8bbfd18 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##             main     #945      +/-   ##
==========================================
+ Coverage   89.16%   89.19%   +0.02%     
==========================================
  Files         203      203              
  Lines        8319     8335      +16     
==========================================
+ Hits         7418     7434      +16     
  Misses        901      901              
Flag Coverage Δ
llc-tests 89.19% <100.00%> (+0.02%) ⬆️
llc-tests-ios12 89.19% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...trollers/ChannelController/ChannelController.swift 92.04% <100.00%> (+0.31%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e77403f...8bbfd18. Read the comment docs.

@@ -788,6 +788,179 @@ class ChannelController_Tests: StressTestCase {
}
}

// MARK: - New direct message channel creation tests

func setupControllerForNewDirectMessageChannel(currentUserId: UserId, otherUserId: UserId) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it took me a while to realize this is not a test. Can you somehow make it more obvious? :) Maybe move it to an extension?

Comment on lines +843 to +903
XCTAssertEqual(controller.channel?.cid, dummyChannel.channel.cid)
XCTAssertEqual(controller.messages.count, dummyChannel.messages.count)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we assert the delegate calls here, too?

controller.callbackQueue = .testQueue(withId: controllerCallbackQueueID)
}

func test_controller_reportsInitialValues_forNewNonexistentDMChannel() throws {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-> test_controller_reportsInitialValues_forDMChannel_ifChannelDoesntExistLocally
+
-> test_controller_reportsInitialValues_forDMChannel_ifChannelExistsLocally
?

Copy link
Contributor

@VojtaStavik VojtaStavik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍 Thank you

@b-onc b-onc force-pushed the fix-new-created-channels-miss-initial-values branch from 3fe1c63 to 8bbfd18 Compare March 31, 2021 15:07
@b-onc b-onc merged commit 013c92d into main Mar 31, 2021
@b-onc b-onc deleted the fix-new-created-channels-miss-initial-values branch March 31, 2021 15:35
b-onc pushed a commit that referenced this pull request Apr 1, 2021
and include missing changelog entry for #945
b-onc pushed a commit that referenced this pull request Apr 6, 2021
and include missing changelog entry for #945
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 Bug An issue or PR related to a bug 🌐 SDK: StreamChat (LLC) Tasks related to the StreamChat LLC SDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants