What would happen, if Snapshot#*nextSnapshotId* re...
# compose
a
What would happen, if Snapshot#*nextSnapshotId* reach max value? Next increment resets it to zero due to overflow, so "monotonically increasing" rule will break?
c
If more than 2^31 snapshots are taken then Snapshot.kt will start behaving in unpredictable ways and is likely to throw an exception but that is not guaranteed. Snapshot.kt should detect this case and, at least, throw a more meaningful error. It should be fixed in a feature release to handle overflowing the id correctly by either using Long internally (making overflow very unlikely as it would take 2^63 snapshots to be taken) or reset the id when it gets too high (which still would not guarantee to fix this as there the app might not give the snapshots a a condition in which it can reset the id). Do you mind submitting a bug for this and assigning it to me?
k
Just reboot your Dreamliner every 248 days
a
Personally, I didn't face such problem, just got curious while inspecting sources. So i'm not sure it requires a bug to be submitted