addFromContact: Don't auto-favorite when CLIENT_BASE; don't update last_heard unless CLIENT_BASE
          #8495
        
          
      
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Clients are now sending an
add_contactAdminMessagebefore basically every text message DM (because clients may hold a larger node database with public keys than the radio holds).This has two unintended side effects:
last_heardis getting incorrectly updated to the current time even when we just send them a DM.CLIENT_BASE, the auto-favoriting inNodeDB::addFromContactmay be causing unintentional routing issues. (Discussion) ForCLIENT_BASEwe should only do explicit favoriting.This PR makes the following changes:
NodeDB::addFromContactCLIENT_BASElast_heard(unless we'reCLIENT_BASE-- see comment in code below)should_ignorethen also clear theis_favoriteflagAdminModule::handleReceivedProtobufCLIENT_BASEClient Possible Issues
I have tested this, and think this should be generally safe, but there are two tiny issues that clients may want to take a look at:
last_heard == 0? This could happen now if they do anadd_contactfor a node that's been evicted.add_contactthat the node will become favorited, and may update their local database accordingly. (This appears to be true in the iOS client, at least -- taking a look now.)Future follow-ups
CLIENT_BASECLIENT_BASEis more explicit, possibly a Yes/No confirm dialog.CLIENT_BASE, we give some sort of message about removing any favorited nodes that are not in their control🤝 Attestations