// DeviceCard reads one Coordinator card without the snapshot's newest-50
13
// window. c_ is reserved for thin cards; legacy ids never fall through here.
14
func (s *Store) DeviceCard(ctx context.Context, person, credential, id string) (out wire.Card, err error) {
15
if !strings.HasPrefix(id, "c_") {
16
return out, ErrNotFound
17
}
18
err = s.read(ctx, func(tx *gorm.DB) error {
19
if s.authority.CurrentPerson(ctx, tx) != nil {
20
return ErrNotFound
21
}
22
if s.pushCurrent(tx, person, credential) != nil {
23
return ErrNotFound
24
}
25
var c cardRecord
26
if err := tx.Where("id = ? AND person = ? AND (held IS NULL OR held = ?) AND coalesce(lane, '') = ?", id, person, false, wire.LaneCoordinator).Take(&c).Error; errors.Is(err, gorm.ErrRecordNotFound) {