Skip to content

Commit

Permalink
feat: Update SDK to 9.2.1 (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexmazlov authored Jul 24, 2024
1 parent d9b1139 commit 534b8e9
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Release Notes

## 9.2.1
### Bug Fixes
- Fixed issue where app would crash when receiving chat messages while backgrounded

## 9.2.0
### New
This version of the SDK adds support for wait offline. This gives the patient the option to close the app, remain in the wait queue, and be notified when their provider is ready for them. To accomplish this, we've added a number of things:
Expand Down
2 changes: 1 addition & 1 deletion DexcareSDK.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'DexcareSDK'
s.version = '9.2.0'
s.version = '9.2.1'
s.platform = :ios, '13.0'
s.swift_version = '5.0'
s.summary = 'DexcareSDK library for express care services'
Expand Down
2 changes: 1 addition & 1 deletion Sources/DexcareiOSSDK/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>9.2.0</string>
<string>9.2.1</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSCameraUsageDescription</key>
Expand Down
13 changes: 11 additions & 2 deletions Sources/DexcareiOSSDK/VirtualVisit/ChatViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ class ChatViewController: MessagesViewController, ChatView {
// Add a small (but not too big) delay on when to refresh the collection view or typing state
// We cancel any previous request if the next one comes in before the delay
// We do need it to be quick enough so we get some immediate feedback when typing in a new message
// This delay has been added to throttle the cascade of messages that are received when a user resumes a visits
// Since only the last message is needed in that scenario
lazy var workItemDelay = 0.1
var typingIndicatorWorkItem: DispatchWorkItem?
var refreshWorkItem: DispatchWorkItem?
Expand Down Expand Up @@ -248,11 +250,16 @@ extension ChatViewController: MessagesDataSource {
/// We added extra logs to track the issue and help us reproduce it.
///
/// Internal Issue: ENG-11367
///
/// Update July 22, 2024
/// The above issue is caused when the user has minimized the app and is receiving messages.
/// The issue can also be resolved by removing workItemDelay mechanism or revamping the chat throttling mechanism.
/// Simply returning a empty chat message appears to have no ill effects (the empty chat mesasges do not appear).
if let message = messages[safe: indexPath.section] {
return message
}
serverLogger?.postMessage(message: "ChatViewController::messageForItem(at \(indexPath.section)) does not exist. Total number of sections = \(messages.count).")
return messages[indexPath.section]
serverLogger?.postMessage(message: "ChatViewController::messageForItem(at \(indexPath.section)) is out of range")
return ChatMessage.empty
}

func numberOfSections(in messagesCollectionView: MessagesCollectionView) -> Int {
Expand Down Expand Up @@ -354,6 +361,8 @@ extension ChatViewController: MessagesDisplayDelegate {
}

struct ChatMessage: MessageType {
static var empty: Self = ChatMessage(sender: ChatSender(id: "", displayName: ""), messageId: "", sentDate: Date(), kind: .text(""))

var sender: SenderType
var messageId: String
var sentDate: Date
Expand Down

0 comments on commit 534b8e9

Please sign in to comment.