Bob handles failure cases with a bit more tact#874
Bob handles failure cases with a bit more tact#874KPrasch merged 13 commits intonucypher:epic-schabowskifrom
Conversation
2e1a924 to
f738977
Compare
| _unknown_ursulas, _known_ursulas, m = self.follow_treasure_map(map_id=map_id, block=True) | ||
|
|
||
| # TODO: Consider blocking until map is done being followed. | ||
| already_retrieved = len(message_kit.capsule._attached_cfrags) >= m |
There was a problem hiding this comment.
Why follow the TMap here - Is it possible to push this check earlier in this method?
There was a problem hiding this comment.
That's interesting. It of course implies that we do have (or at least have the possibility of having) cached cfrags. Wanna make an Issue?
…against this Capsule before.
…n Bob gathers CFrags.
|
Are you still thinking that |
|
@KPrasch: As for On one hand, it's more confusing, without a doubt. I think that it's very reasonable for users to expect the behavior they'll get with On the other hand, it's possibly more secure for some (albeit very rare) real-world scenarios. Obviously, in these scenarios, we hope that people RTFM and set I truly can go either way on it. |
| policy_arrangement = datastore.get_policy_arrangement(arrangement_id=id_as_hex.encode(), | ||
| session=session) | ||
| work_order = WorkOrder.from_rest_payload(arrangement_id, request.data) | ||
| log.info("Work Order from {}, signed {}".format(work_order.bob, work_order.receipt_signature)) |
| for work_order in work_orders: | ||
| try: | ||
| cfrags = self.get_reencrypted_cfrags(work_order) | ||
| except (requests.exceptions.ConnectTimeout, NotFound): |
|
Merging into epic. |
Bob previously had trouble retrieving twice. Ursula raised an error instead of 404'ing if a KFrag was
NotFound. Both of these are fixed, as well as smoothing out the retrieval flow and adding some test logic.Fixes #833
Fixes #851
Opened #892
Note: Presently, even though Bob can retrieve multiple times, he does not pass
cache=Truetoretrieve(...)in any of the control APIs, so he will still fail in this case. If we determine that this is the sane default, I'll add it in this PR. If more discussion is in order, it can be added later or as an option for dapp developers.