BitShares Forum

Main => Technical Support => Topic started by: monsterer on December 12, 2015, 05:59:42 pm

Title: database_api.cpp:229 get_objects getObjects without subscribe callback??
Post by: monsterer on December 12, 2015, 05:59:42 pm
I've suddenly started getting this message - I have upgraded to the latest bitshares hardforking release. I've not seen this error in the previous version, any idea what it means?
Title: Re: database_api.cpp:229 get_objects getObjects without subscribe callback??
Post by: roadscape on December 13, 2015, 12:18:08 am
I've been receiving this message intermittently for weeks, I think it might be triggered by RPC calls. Not sure what it means, I assumed it was just an innocuous debug message
Title: Re: database_api.cpp:229 get_objects getObjects without subscribe callback??
Post by: hybridd on December 13, 2015, 12:26:09 am
I've been receiving this message intermittently for weeks, I think it might be triggered by RPC calls. Not sure what it means, I assumed it was just an innocuous debug message

Code: [Select]
   if( _subscribe_callback )  {
      for( auto id : ids )
      {
         if( id.type() == operation_history_object_type && id.space() == protocol_ids ) continue;
         if( id.type() == impl_account_transaction_history_object_type && id.space() == implementation_ids ) continue;

         this->subscribe_to_item( id );
      }
   }
   else
   {
      elog( "getObjects without subscribe callback??" );
   }

Would seem so.
Title: Re: database_api.cpp:229 get_objects getObjects without subscribe callback??
Post by: xeroc on December 15, 2015, 12:15:22 pm
The reason for this warning is that the witness node expects users to first "register" with the database api before they query for database stuff ..
In this case you asked something from the database and haven't requested access to the database yet
http://docs.bitshares.eu/api/websocket.html#requesting-api-access
Title: Re: database_api.cpp:229 get_objects getObjects without subscribe callback??
Post by: bytemaster on December 15, 2015, 02:26:18 pm
The reason for this warning is that the witness node expects users to first "register" with the database api before they query for database stuff ..
In this case you asked something from the database and haven't requested access to the database yet
http://docs.bitshares.eu/api/websocket.html#requesting-api-access

Not quite.  The reason for this is an assumption that the GUI wants push notifications of changes to any object it has queried. This message was put there to detect instances where the GUI was misusing the API.  However, it can safely be ignored if you don't care about getting updates.  We can probably delete the warning all together.