badoo / badoo/Chatto

How to Solved Assertion failed: Invalid cell given to presenter issue

Open
#505 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
Swift
Stars
4.6k
Forks
588
PR merge metrics
No merged PRs in 30d

Description

I populated API data on chat view controller. Not able to receive photo messages. When someone send a photo message then app crash in BaseMessagePresenter's configure cell function.

Error in line no 88 :Assertion failed: Invalid cell given to presenter issue

`


public final override func configureCell(_ cell: UICollectionViewCell, decorationAttributes:

ChatItemDecorationAttributesProtocol?)

{
guard let cell1 = cell as? CellT else {
assert(false, "Invalid cell given to presenter")
return
}

guard let decorationAttributes = decorationAttributes as? ChatItemDecorationAttributes else {
assert(false, "Expecting decoration attributes")
return
}

print("print cell cellT :\(type(of:cell1))")
self.decorationAttributes = decorationAttributes
self.configureCell(cell1, decorationAttributes: decorationAttributes, animated: false, additionalConfiguration: nil)
}`

Contributor guide

Open the contributing guide

Research direction

Start in BaseMessagePresenter's configureCell function at line 88 and trace how the chat view controller registers and supplies cells for photo messages. Reproduce the crash with a photo message and inspect the cell type passed to configureCell. Done means photo messages no longer trigger the invalid-cell assertion.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.