h-REA / hREA

A ValueFlows / REA economic network coordination system implemented on Holochain and with supplied Javascript GraphQL libraries
https://docs.hrea.io
Other
143 stars 15 forks source link

implement `getMyAgent` query, and backend zome fn #303

Closed Connoropolous closed 2 years ago

Connoropolous commented 2 years ago

This depends on #302

Do a lookup from the current users AgentPubKey via get_links to any related Agent record. Just take the first one and return it. We will naively assume one-key one-person for now

weswalla commented 2 years ago

currently blocked until we determine if it returns a single agent entry, or a vec, which may require changes to vf spec

pospi commented 2 years ago

Single agent entry please! We discussed inferring this from the user's local sourcechain and picking only the latest linked entry, which will resolve any duplicate link issues.

This would be a totally different logic to #309, but that is not needed for MMR.

pospi commented 2 years ago

Thinking more about it, to prepare for #309 it would be best to add some validation to ensure that only a single link from an AgentPubKey to a profile can be made, and add logic to delete any existing links before assignment. Such validation should be safe to add for well-intentioned agents since all data necessary to make the check will exist on the local sourcechain.