From d602f251e06e3ccb7e79751fc0f1bd4eebaa9d25 Mon Sep 17 00:00:00 2001 From: SimplifiedPrivacy Date: Thu, 21 May 2026 13:10:51 -0400 Subject: [PATCH] Improved Ticket UI messaging and and flow --- .../tickets/TicketPayController.py | 20 +++++++++---------- .../tickets/TicketPrepController.py | 3 +++ .../tickets/TicketSyncController.py | 4 ---- .../ticket_prep_orchestrator.py | 10 ++++++++++ pyproject.toml | 2 +- 5 files changed, 24 insertions(+), 15 deletions(-) diff --git a/core/controllers/tickets/TicketPayController.py b/core/controllers/tickets/TicketPayController.py index 971b294..c3123a0 100644 --- a/core/controllers/tickets/TicketPayController.py +++ b/core/controllers/tickets/TicketPayController.py @@ -13,7 +13,7 @@ from core.services.payment_phase.check_if_paid import _check_if_paid from core.services.prepare_tickets.ticket_tracker import does_ticket_tracker_exist from core.services.networking.send_data_to_server import send_data_to_server from core.services.networking.make_url import make_url -from core.utils.confirm_its_a_valid_key_choice import confirm_its_a_valid_key_choice +# from core.utils.confirm_its_a_valid_key_choice import confirm_its_a_valid_key_choice from core.services.helpers.valid_profile_quantity import valid_profile_quantity from core.errors.exceptions import * from core.errors.logger import logger @@ -69,15 +69,15 @@ def initiate_payment( # confirm the key choice is among the choices from their sync file, # and if not, then sync again, and try the results from that new file, - is_valid_key = confirm_its_a_valid_key_choice(which_key, ticket_observer) - if not is_valid_key: - sync_results = sync_ticket_prices(ticket_observer, connection_observer) - second_try_to_match = confirm_its_a_valid_key_choice( - which_key, ticket_observer - ) - if not second_try_to_match: - invoice_data_object.add_error_code("invalid_key") - return invoice_data_object + # is_valid_key = confirm_its_a_valid_key_choice(which_key, ticket_observer) + # if not is_valid_key: + # sync_results = sync_ticket_prices(ticket_observer, connection_observer) + # second_try_to_match = confirm_its_a_valid_key_choice( + # which_key, ticket_observer + # ) + # if not second_try_to_match: + # invoice_data_object.add_error_code("invalid_key") + # return invoice_data_object # get & save the public key: public_key_results = get_pub_key(which_key, connection_observer, "local") diff --git a/core/controllers/tickets/TicketPrepController.py b/core/controllers/tickets/TicketPrepController.py index a7580ba..6dee302 100644 --- a/core/controllers/tickets/TicketPrepController.py +++ b/core/controllers/tickets/TicketPrepController.py @@ -51,6 +51,9 @@ def prepare_tickets( ticket_observer.notify("failed_input", None) return {"valid": False, "error_code": "failed_input"} + notification = "Preparing Cryptography Locally" + ticket_observer.notify("preparing", subject=notification) + # ok now we have the pre-reqs, let's use this high level orchestrator, prep_results = ticket_prep_orchestrator( how_many_profiles, ticket_observer, connection_observer diff --git a/core/controllers/tickets/TicketSyncController.py b/core/controllers/tickets/TicketSyncController.py index d616280..461b7b2 100644 --- a/core/controllers/tickets/TicketSyncController.py +++ b/core/controllers/tickets/TicketSyncController.py @@ -8,7 +8,6 @@ if TYPE_CHECKING: from core.Constants import Constants from core.observers.BaseObserver import BaseObserver from core.services.networking.get_data_from_server import get_data_from_server -from core.services.helpers.save_sync_results import save_sync_results from core.errors.logger import logger @@ -38,7 +37,4 @@ def sync_ticket_prices( except: return {"valid": False, "error_code": "sync_failed"} - did_it_save = save_sync_results(sync_results) - logger.debug(f"Inside the sync controller, did_it_save is {did_it_save}") - return sync_results diff --git a/core/services/prepare_tickets/ticket_prep_orchestrator.py b/core/services/prepare_tickets/ticket_prep_orchestrator.py index db961b7..8e4b59e 100644 --- a/core/services/prepare_tickets/ticket_prep_orchestrator.py +++ b/core/services/prepare_tickets/ticket_prep_orchestrator.py @@ -37,6 +37,8 @@ def ticket_prep_orchestrator( } # assuming we actually saved the unblinding factors, + notification = "Sending Blinded Package to the Server.." + ticket_observer.notify("preparing", subject=notification) # then send the entire blinded list to the server to sign: blind_signatures = send_blind_commitments( @@ -56,9 +58,13 @@ def ticket_prep_orchestrator( else: # regardless of the outcome of the verification, save all blind sigs, just in case, because the user can't get them again, + notification = "Saving the Server's Blind Replies" + ticket_observer.notify("preparing", subject=notification) did_they_ALL_save = save_ALL_blind_sigs(blind_signatures) # verify the server's blind signatures against the public key, + notification = "Evaluating the Server's Blind Replies" + ticket_observer.notify("preparing", subject=notification) failed_validations = validate_blind_signatures( blind_signatures, ticket_observer, connection_observer ) @@ -68,6 +74,8 @@ def ticket_prep_orchestrator( # did verification of any of the blind sigs fail? how_many_failed = len(failed_validations) if how_many_failed >= 1: + notification = f"Verification failed for {how_many_failed} blind signatures." + ticket_observer.notify("preparing", subject=notification) logger.debug( f"Verification failed for {how_many_failed} blind signatures." ) @@ -79,6 +87,8 @@ def ticket_prep_orchestrator( } # Unblind the signatures & combine with unblinded commitment: + notification = f"Unblinding Signatures & Preparing Tickets..." + ticket_observer.notify("preparing", subject=notification) did_prep_work = unblind_ALL_tickets( blind_signatures, ticket_observer, connection_observer ) diff --git a/pyproject.toml b/pyproject.toml index ab95690..6812189 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "sp-hydra-veil-core" -version = "2.3.1" +version = "2.3.2" authors = [ { name = "Simplified Privacy" }, ]