package.loader: Check for snapshot id prior to reifying model object
This is an issue mostly encountered on staging. But technically, the error
could happen in production as snapshot_get_all_branches could return None as
well (which is currently ignored). If that happens though, Snapshot.from_dict
raises.
Most proeminent in staging, because we can mount partial dump from production. Thus not everything exists. Typically, recently we mounted a partial dump of origins/origin-visits only. This means origin visits will target inexisting snapshots [1]
Thix fix ensures we can use staging nonetheless. This also improves the current implementation path so win.
Related to #2428 (closed)
Test Plan
tox
Migrated from D3196 (view on Phabricator)