You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This results in lots of bugs. For example: #627, #490, #530, #925. These are just the ones related to auth token handling I found within tha last 10 minutes; I have found other ones in the past and still regularly get surprised by it.
breaks loudly when self.auth_token isn't set; avoiding a bug. But because it's defaulted to None, it silently continues and a bug is introduced.
I think we should not set things to None and then rely on everybody not forgetting to call whatever magic state updating functions.
Instead, if possible, we should construct values with their correct values initially.
I don't know what exactly is responsible for this situation / how it came to be this way. I suspect it's the "self.something variables magically update the sqlite DB, much convenient" logic that nixops currently has instead of explicit separation of what is stored state and what isn't, but I haven't convinced myself of that yet.
The text was updated successfully, but these errors were encountered:
I am running into this issue right now, specifically with the netmask attribute being null on this line. I'm not sure how to resolve that issue and definitely would like the whole backend to be more robust to this kind of error.
A common idiom in nixops
MachineState
subclasses is the initialisation of lots of fields toNone
. For example:nixops/nixops/backends/digital_ocean.py
Line 64 in da33620
This results in lots of bugs. For example: #627, #490, #530, #925. These are just the ones related to auth token handling I found within tha last 10 minutes; I have found other ones in the past and still regularly get surprised by it.
Usually, code like
nixops/nixops/backends/digital_ocean.py
Lines 114 to 115 in da33620
self.auth_token
isn't set; avoiding a bug. But because it's defaulted toNone
, it silently continues and a bug is introduced.I think we should not set things to None and then rely on everybody not forgetting to call whatever magic state updating functions.
Instead, if possible, we should construct values with their correct values initially.
I don't know what exactly is responsible for this situation / how it came to be this way. I suspect it's the "
self.something
variables magically update the sqlite DB, much convenient" logic that nixops currently has instead of explicit separation of what is stored state and what isn't, but I haven't convinced myself of that yet.The text was updated successfully, but these errors were encountered: