File tree Expand file tree Collapse file tree 4 files changed +16
-6
lines changed
Expand file tree Collapse file tree 4 files changed +16
-6
lines changed Original file line number Diff line number Diff line change 11Pod ::Spec . new do |s |
22s . name = "QiscusCore"
3- s . version = "1.13.2 "
3+ s . version = "1.13.3 "
44s . summary = "Qiscus Core SDK for iOS"
55s . description = <<-DESC
66Qiscus SDK for iOS contains Qiscus public Model.
Original file line number Diff line number Diff line change @@ -267,9 +267,13 @@ public class CommentDB {
267267 let myCommentBefore = myComments. filter ( { $0. unixTimestamp < comment. unixTimestamp } )
268268 for c in myCommentBefore {
269269 // update comment
270- if c. status. intValue < comment. status. intValue {
271- c. status = . read
272- QiscusCore . database. comment. save ( [ c] )
270+ if c. status. intValue < comment. status. intValue{
271+ if c. status == . pending || c. status == . failed {
272+ //no action
273+ } else {
274+ c. status = . read
275+ QiscusCore . database. comment. save ( [ c] )
276+ }
273277 }
274278 }
275279 }
Original file line number Diff line number Diff line change @@ -116,7 +116,7 @@ extension QiscusCore {
116116
117117 if error != nil {
118118 //check error
119- if ( error? . contains ( " Validation error " ) == true ) {
119+ if ( error? . contains ( " Validation error " ) == true || error ? . contains ( " Response not JSON or undefined " ) == true ) {
120120 //save in local comment failed
121121 _comment. status = . failed
122122 QiscusCore . database. comment. save ( [ _comment] )
@@ -208,7 +208,7 @@ extension QiscusCore {
208208
209209 if error != nil {
210210 //check error
211- if ( error? . contains ( " Validation error " ) == true ) {
211+ if ( error? . contains ( " Validation error " ) == true || error ? . contains ( " Response not JSON or undefined " ) == true ) {
212212 //save in local comment failed
213213 _comment. status = . failed
214214 QiscusCore . database. comment. save ( [ _comment] )
Original file line number Diff line number Diff line change @@ -203,6 +203,12 @@ class QiscusWorkerManager {
203203
204204 private func sendPendingMessage( ) {
205205 guard let comments = QiscusCore . database. comment. find ( status: . pending) else { return }
206+
207+ if comments. count >= 1 {
208+ self . synchronize ( )
209+ }
210+
211+
206212 comments. reversed ( ) . forEach { ( c) in
207213 // validation comment prevent id
208214 if c. uniqId. isEmpty { QiscusCore . database. comment. evaluate ( ) ; return }
You can’t perform that action at this time.
0 commit comments