Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
Elixxir dApps SDK Swift
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mobile
iOS
Elixxir dApps SDK Swift
Merge requests
!48
Handle missing round results in MessageDeliveryCallback
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Handle missing round results in MessageDeliveryCallback
fix/message-delivery-callback
into
development
Overview
0
Commits
1
Pipelines
0
Changes
1
Merged
Dariusz Rybicki
requested to merge
fix/message-delivery-callback
into
development
2 years ago
Overview
0
Commits
1
Pipelines
0
Changes
1
Expand
0
0
Merge request reports
Viewing commit
ff2bca68
Show latest version
1 file
+
10
−
7
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
ff2bca68
Handle missing round results in MessageDeliveryCallback
· ff2bca68
Dariusz Rybicki
authored
2 years ago
Sources/XXClient/Callbacks/MessageDeliveryCallback.swift
+
10
−
7
Options
@@ -30,12 +30,15 @@ extension MessageDeliveryCallback {
let
callback
:
MessageDeliveryCallback
func
eventCallback
(
_
delivered
:
Bool
,
timedOut
:
Bool
,
roundResults
:
Data
?)
{
if
delivered
,
!
timedOut
,
let
roundResultsData
=
roundResults
,
let
roundResults
=
try
?
JSONDecoder
()
.
decode
([
Int
]
.
self
,
from
:
roundResultsData
)
{
callback
.
handle
(
.
delivered
(
roundResults
:
roundResults
))
if
delivered
&&
!
timedOut
{
let
roundResultsArray
:
[
Int
]
if
let
data
=
roundResults
,
let
array
=
try
?
JSONDecoder
()
.
decode
([
Int
]
.
self
,
from
:
data
)
{
roundResultsArray
=
array
}
else
{
roundResultsArray
=
[]
}
callback
.
handle
(
.
delivered
(
roundResults
:
roundResultsArray
))
return
}
@@ -48,7 +51,7 @@ extension MessageDeliveryCallback {
BindingsMessageDeliveryCallback received invalid parameters:
- delivered →
\(
delivered
)
- timedOut →
\(
timedOut
)
- roundResults →
\(
roundResults
.
map
{
String
(
data
:
$0
,
encoding
:
.
utf8
)
??
""
}
??
""
)
- roundResults →
\(
roundResults
.
map
{
String
(
data
:
$0
,
encoding
:
.
utf8
)
??
"
\(
$0
)
"
}
??
"
nil
"
)
"""
)
}
}
Loading