Skip to content

Failure to store a new randomly generated voucher string does not interrupt the payment workflow  #381

@exarkun

Description

@exarkun

One time when trying to buy new ZKAPs I did not receive any. Though I completed the user-facing payment workflow and waited a while, my client remained passless.

Later, in the GridSync logs, I observed this:

2021-09-07 08:34:50,994 CRITICAL publishToNewObserver Unhandled error in Deferred:
2021-09-07 08:34:50,995 CRITICAL publishToNewObserver 
Traceback (most recent call last):
  File "/nix/store/fmp9c8sk8c83q4mc3762is8s4ia6hbk5-result/lib/python3.9/site-packages/gridsync/gui/usage.py", line 161, in _open_zkap_payment_url
    yield self.gateway.zkapauthorizer.add_voucher(voucher)
  File "/nix/store/fmp9c8sk8c83q4mc3762is8s4ia6hbk5-result/lib/python3.9/site-packages/gridsync/zkapauthorizer.py", line 59, in add_voucher
    resp = yield self._request(
  File "/nix/store/fmp9c8sk8c83q4mc3762is8s4ia6hbk5-result/lib/python3.9/site-packages/gridsync/zkapauthorizer.py", line 42, in _request
    resp = yield treq.request(
  File "/nix/store/7kdy0zz1vlb72lr5b17awjjyb7ib6izs-python3.9-Twisted-21.7.0/lib/python3.9/site-packages/twisted/web/client.py", line 1753, in request
    endpoint = self._getEndpoint(parsedURI)
  File "/nix/store/7kdy0zz1vlb72lr5b17awjjyb7ib6izs-python3.9-Twisted-21.7.0/lib/python3.9/site-packages/twisted/web/client.py", line 1737, in _getEndpoint
    return self._endpointFactory.endpointForURI(uri)
  File "/nix/store/7kdy0zz1vlb72lr5b17awjjyb7ib6izs-python3.9-Twisted-21.7.0/lib/python3.9/site-packages/twisted/web/client.py", line 1613, in endpointForURI
    raise SchemeNotSupported(f"Unsupported scheme: {uri.scheme!r}")
twisted.web.error.SchemeNotSupported: Unsupported scheme: b''

And then, on inspecting the ZKAPAuthorizer internal database, I found there were no vouchers there.

So it seems like GridSync failed (for some reason I don't understand right now) to tell ZKAPAuthorizer about the voucher but then allowed the payment workflow to proceed anyway. In the typical case this probably results in the client losing the value of the payment because they will have received no ZKAPs and be able to store nothing on the grid.

Apart from whatever the specific issue is that caused the voucher to not be recorded, GridSync should not proceed to payment without confirmation that the voucher has been stored.

Observed on NixOS 21.05 with PrivateStorageDesktop 6c19ffff02a496a06f28ae6efc6575aa69d78825 with some small changes to fix Nix packaging issues, including a tweak to use GridSync 72628bc (which is a Nix packaging branch stacked on #379 which is itself stacked on 290.new-magic-folder.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions