chore: update passport API#1315
Conversation
sdsantos
left a comment
There was a problem hiding this comment.
Should we create a ticket for storing the verification status of a measurement? Maybe to show it in the UI in the future?
| ) : SubmitError(raw) | ||
|
|
||
| companion object { | ||
| fun fromWire(value: String?): SubmitError? = |
There was a problem hiding this comment.
Maybe fromPassport is a bit more clear?
| private val deleteFiles: DeleteFiles, | ||
| private val updateMeasurement: suspend (MeasurementModel) -> Unit, | ||
| private val deleteMeasurementById: suspend (MeasurementModel.Id) -> Unit, | ||
| private val handleSubmitOutcome: suspend (VerificationStatus, SubmitError?) -> Unit = { _, _ -> }, |
| } | ||
|
|
||
| when (error) { | ||
| SubmitError.ManifestNotFound -> retrieveManifest() |
There was a problem hiding this comment.
If we failed to already fetch a Manifest, and we try on every background run, I don't think we should retry on every failed submission with ManifestNotFound too.
| HandleSubmitOutcome( | ||
| retrieveManifest = { retrieveManifest() }, | ||
| clearCredential = clearCredential, | ||
| signalUpdateRequired = {}, |
There was a problem hiding this comment.
We should mark this as TODO and create a ticket for it, if it's not done yet.
| suspend operator fun invoke(content: String): String { | ||
| val credential = getCredential() ?: return content | ||
| val parsed = try { | ||
| json.parseToJsonElement(content) as? JsonObject |
There was a problem hiding this comment.
You could use as instead, and catch the CastException below, to avoid it failing silently.
| val ccOk = entry.match.probeCc == WILDCARD || entry.match.probeCc == probeCc | ||
| val asnOk = entry.match.probeAsn == WILDCARD || entry.match.probeAsn == probeAsn |
There was a problem hiding this comment.
We don't need to worry about case sensitivity for CC and ASNs?
| if (credential == null) return null | ||
| val ranges = resolveSubmissionPolicy(manifest, data.probeCc, data.probeAsn) ?: run { | ||
| Logger.w("No submission_policy entry for cc=${data.probeCc} asn=${data.probeAsn}") | ||
| return null |
There was a problem hiding this comment.
Without ageRange and measurementCountRange we shouldn't send any credential then? Just to confirm, could not find that in the documentation.
No description provided.