- warn "## update_state( $k => $v, ", dump( $state ), " )\n" if $self->debug;
-
- my $uid;
-
- if ( $k eq 'ID' ) {
- if ( $uid = $self->ID_to_uid( $v, $state ) ) {
- # nop
- } else {
- warn "## no uid for $v, first seen?\n" if $self->debug;
- return;
- }
- } else {
- $uid = $v;
- }
-
- if ( my $o = $self->db->get('state')->get( $uid ) ) {
- warn "## update state of $uid [$v]\n" if $self->debug;
- return $o->import( $state );
- } else {
- warn "## create new state for $uid [$v]\n" if $self->debug;
- return $self->db->get('state')->put( $uid => $state );
- }
+ my $uid = $self->state_to_uid( $state );
+
+ warn "#### update_state( ", dump( $state ), " ) for $uid\n" if $self->debug > 2;
+ $self->current_store->update_uid_state( $uid, $state );