MS-1058 Prep work for sample upload with signed urls#1251
Conversation
7e70ab2 to
822814a
Compare
822814a to
9c589d3
Compare
9c589d3 to
1d6f00a
Compare
6b30ab0 to
4f924ac
Compare
4f924ac to
551f5aa
Compare
| !synchronization.hasSamples() || | ||
| synchronization.up.simprints.batchSizes | ||
| .let { it.eventUpSyncs == 0 || it.eventDownSyncs == 0 } | ||
| } |
There was a problem hiding this comment.
This is just a general comment
Don't you find such conditions difficult to read? While it is a relatively short notation, wouldn't it be better to write such conditions in more human-friendly format?
with (currentData) {
val hasNoSamples = !synchronization.hasSamples()
val batchSizeIsEmpty = synchronization.up.simprints.batchSizes
.let { it.eventUpSyncs == 0 || it.eventDownSyncs == 0 }
return@with hasNoSamples || batchSizeIsEmpty
}
| maxAge = DownSynchronizationConfiguration.DEFAULT_DOWN_SYNC_MAX_AGE, | ||
| ), | ||
| samples = SampleSynchronizationConfiguration( | ||
| signedUrlBatchSize = 5, |
There was a problem hiding this comment.
Should move it to a constant field?
There was a problem hiding this comment.
Sure, although this is a very old migration, and there is little difference.
| content: EventUpSyncRequestEvent.UpSyncContent, | ||
| ) { | ||
| if (content.sessionCount > 0 || content.eventDownSyncCount > 0 || content.eventUpSyncCount > 0) { | ||
| if (content.sessionCount > 0 || content.eventDownSyncCount > 0 || content.eventUpSyncCount > 0 || content.sampleUpSyncCount > 0) { |
There was a problem hiding this comment.
Maybe it's time to refactor it a bit
val shouldAdd = listOf(content.sessionCount, content.eventDownSyncCount, content.eventUpSyncCount, content.sampleUpSyncCount).any { it > 0 }
if (shouldAdd) { ... }
There was a problem hiding this comment.
I will move the check to a method in the content class to shorten the access.
In general, for string/null check I would agree. Making a full list object to iterate over a couple of boolean flags just feels wrong, tho. :D
299fa10 to
83a7b62
Compare
|



JIRA ticket
Will be released in: 2025.3.0
Notable changes
Testing guidance
Additional work checklist