Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Problem Report Before Exchange Established #2519

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 4 additions & 14 deletions aries_cloudagent/protocols/issue_credential/v1_0/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -692,13 +692,8 @@ async def credential_exchange_send_proposal(request: web.BaseRequest):
if cred_ex_record:
async with profile.session() as session:
await cred_ex_record.save_error_state(session, reason=err.roll_up)
await report_problem(
err,
ProblemReportReason.ISSUANCE_ABANDONED.value,
web.HTTPBadRequest,
cred_ex_record or connection_record,
outbound_handler,
)
# other party cannot yet receive a problem report about our failed protocol start
raise web.HTTPBadRequest(reason=err.roll_up)

await outbound_handler(
credential_proposal,
Expand Down Expand Up @@ -903,13 +898,8 @@ async def credential_exchange_send_free_offer(request: web.BaseRequest):
if cred_ex_record:
async with profile.session() as session:
await cred_ex_record.save_error_state(session, reason=err.roll_up)
await report_problem(
err,
ProblemReportReason.ISSUANCE_ABANDONED.value,
web.HTTPBadRequest,
cred_ex_record or connection_record,
outbound_handler,
)
# other party cannot yet receive a problem report about our failed protocol start
raise web.HTTPBadRequest(reason=err.roll_up)

await outbound_handler(credential_offer_message, connection_id=connection_id)

Expand Down
27 changes: 6 additions & 21 deletions aries_cloudagent/protocols/issue_credential/v2_0/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -835,13 +835,8 @@ async def credential_exchange_send_proposal(request: web.BaseRequest):
if cred_ex_record:
async with profile.session() as session:
await cred_ex_record.save_error_state(session, reason=err.roll_up)
await report_problem(
err,
ProblemReportReason.ISSUANCE_ABANDONED.value,
web.HTTPBadRequest,
cred_ex_record or conn_record,
outbound_handler,
)
# other party cannot yet receive a problem report about our failed protocol start
raise web.HTTPBadRequest(reason=err.roll_up)

await outbound_handler(cred_proposal_message, connection_id=connection_id)

Expand Down Expand Up @@ -1042,13 +1037,8 @@ async def credential_exchange_send_free_offer(request: web.BaseRequest):
if cred_ex_record:
async with profile.session() as session:
await cred_ex_record.save_error_state(session, reason=err.roll_up)
await report_problem(
err,
ProblemReportReason.ISSUANCE_ABANDONED.value,
web.HTTPBadRequest,
cred_ex_record or conn_record,
outbound_handler,
)
# other party cannot yet receive a problem report about our failed protocol start
raise web.HTTPBadRequest(reason=err.roll_up)

await outbound_handler(cred_offer_message, connection_id=connection_id)

Expand Down Expand Up @@ -1252,13 +1242,8 @@ async def credential_exchange_send_free_request(request: web.BaseRequest):
if cred_ex_record:
async with profile.session() as session:
await cred_ex_record.save_error_state(session, reason=err.roll_up)
await report_problem(
err,
ProblemReportReason.ISSUANCE_ABANDONED.value,
web.HTTPBadRequest,
cred_ex_record,
outbound_handler,
)
# other party cannot yet receive a problem report about our failed protocol start
raise web.HTTPBadRequest(reason=err.roll_up)

await outbound_handler(cred_request_message, connection_id=connection_id)

Expand Down