Its actually because config.changed.snapd_refresh and snap.installed.core may not be set in the same hook, so the handler will never run (eg. config was set on initial deploy, but no snaps installed until a particular relation has been joined). Which is why there are proposals to change the lifecycle of the config.changed.* flags, which would give the snap control over the lifecycle of the config.changed.snapd_refresh flag, and would allow me to use the simpler @when syntax ;) The trigger pattern avoids the confusion altogether, and quickly becomes obvious when you see it used a few times.
Its actually because config. changed. snapd_refresh and snap.installed.core may not be set in the same hook, so the handler will never run (eg. config was set on initial deploy, but no snaps installed until a particular relation has been joined). Which is why there are proposals to change the lifecycle of the config.changed.* flags, which would give the snap control over the lifecycle of the config. changed. snapd_refresh flag, and would allow me to use the simpler @when syntax ;) The trigger pattern avoids the confusion altogether, and quickly becomes obvious when you see it used a few times.