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

[CIS-1148] Fix crash on channel delete event #1408

Merged
merged 2 commits into from Aug 26, 2021

Conversation

nuno-vieira
Copy link
Member

@nuno-vieira nuno-vieira commented Aug 26, 2021

Description of the pull request

In a channel delete event, we try to parse the createdBy relationship of the ChannelDTO, but it doesn't exist, so it crashes. ChatChannel.createdBy was already optional, so there are no changes required in the customer's code.

Fixes: #1404

@nuno-vieira nuno-vieira added the 🐞 Bug An issue or PR related to a bug label Aug 26, 2021
@nuno-vieira nuno-vieira requested a review from a team August 26, 2021 15:14
@codecov-commenter
Copy link

codecov-commenter commented Aug 26, 2021

Codecov Report

Merging #1408 (69fb6e7) into main (02574da) will increase coverage by 0.06%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1408      +/-   ##
==========================================
+ Coverage   90.71%   90.77%   +0.06%     
==========================================
  Files         224      224              
  Lines        9873     9873              
==========================================
+ Hits         8956     8962       +6     
+ Misses        917      911       -6     
Flag Coverage Δ
llc-tests 90.77% <100.00%> (+0.06%) ⬆️

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

Impacted Files Coverage Δ
Sources/StreamChat/Database/DTOs/ChannelDTO.swift 93.99% <100.00%> (ø)
...eamChat/APIClient/Endpoints/Payloads/RawJSON.swift 87.17% <0.00%> (-12.83%) ⬇️
.../ChannelListController/ChannelListController.swift 91.33% <0.00%> (+8.66%) ⬆️

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 02574da...69fb6e7. Read the comment docs.

Copy link
Contributor

@evsaev evsaev left a comment

Choose a reason for hiding this comment

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

👍

@nuno-vieira nuno-vieira merged commit f42a93a into main Aug 26, 2021
@nuno-vieira nuno-vieira deleted the CIS-1148-Crash-force-unwrap-createdBy branch August 26, 2021 15:54
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Application crashes - ChatUser.create(fromDTO:)
3 participants