Hello all,
Checking the snapd source, I see in https://github.com/snapcore/snapd/blob/master/overlord/auth/auth.go#L424 that the environment variable UBUNTU_STORE_ID has more precedence that the store defined in the model assertion.
On the other hand, the model assertion is used to register the device and obtain a serial which is needed to obtain a device session, which then is used in every request against the store. So if there is a mismatch between these two (the store in the model assertion and the store in the env variable) the device will misbehave.
I think we should have the env variable UBUNTU_STORE_ID only be honoured if there is no model assertion in the device. Can you think of any reason why this could be an issue?
Thanks!