Closed ptr727 closed 2 years ago
@ptr727 I haven't checked this with devs. But what if releaseInfo.release_date = 0 or releaseInfo.release_delivery_days < 0?
I think when designing this we left some flexibility in terms of how releases can be published and how our client reacts to them.
When you say you've never seen this -- do you mean our prod JSON files never had such a state? Though I'm not sure if they had such a state or not, we may want to use this in the future. So I would recommend replicating this logic.
Thank you for replying.
When I said "I have yet to see", I mean in the JSON files being produced, i.e. I have never seen any negative values, just ""
or null
or 0
.
Per your suggestion I'll duplicate the logic, in anticipation of a negative value possibly being used.
I am updating the logic in my app to follow the same logic for determining when a
release
is stable or pre-release.I was looking at the logic in
selectVmsRelease()
,canReceiveUnpublishedBuild()
, andisBuildPublished()
innx_open\vms\libs\nx_vms_update\src\nx\vms\update\releases_info.cpp
.The JSON for
release_date
is as a""
ornull
, while therelease_delivery_days
isint
ornull
.I am not 100% sure how your JSON C++ parser coverts the
null
to an int, and I am assuming it convert to default0
.If that is the case,
releaseInfo.release_delivery_days >= 0
will always be true, unless the JSON sets the value explicitly as a negative value, and I have yet to see any JSON that is not a quoted string int64 number (epoch milliseconds) or anull
.Am I misunderstanding the logic, or can I ignore
releaseInfo.release_delivery_days >= 0
?