View Issue Details

IDProjectCategoryView StatusLast Update
0006700Talerwallet (TS core)public2021-08-24 16:23
Reportersebasjm Assigned ToFlorian Dold  
PrioritynormalSeverityblockReproducibilityalways
Status closedResolutionfixed 
Target Version0.8Fixed in Version0.8 
Summary0006700: wallet doesnt work when merchant is configured with a [merchant-auditor-demo] section
Descriptionwallet tested in chrome using source from https://git.taler.net/wallet-core.git
version: 0.8.0.4, git commit: 0828e65f

merchant-backend built from git://taler.net/merchant
git ref: v0.8.0

I my working example I have a [merchant-exchange-demo] properly configured and it works. I can spend coins using the blog.
When I restart the same system with the merchant configured using a [merchant-auditor-demo] the wallet crash with an exception in the console [1]

What I have found is that when the wallet request the merchant-backend for the /claim example:
curl 'http://merchant-backend.taler:9966/instances/blog/orders/2021.014-02PE3KD4TQR6C/claim' -d '{"nonce":"QJ5065KTM75S52X9T10Y2A9WSVDVHGW97AASFFB4GCNJQHGRM380","token":"1BVHN7Y1XB273JKFC3BE9ZNHAC"}'

it gets a response :

{
  "contract_terms": {
  ...
    "auditors": [
      {
        "name": "demo",
        "auditor_pub": "RVDXQVF2PVTK57EW13QTB6E44QRCPAQJBYKXPA1HCKXEGQETYVF0",
        "url": "http://auditor.taler:8083/"
      }
    ],
   ...
}
  
the exception is very clear ( from [1] ) it expect master_pub inside auditor[0] but the merchant is sending auditor_pub instead.
Related code I have found lead me into talerTypes.ts, function codecForAuditorHandle line around 1058.

The question is: should the merchant backend respond master_pub or the wallet expecte an auditor_pub ?

[1]
{
  "type": "error",
  "operation": "preparePay",
  "id": "(none)",
  "error": {
    "code": 7001,
    "hint": "Error: WALLET_UNEXPECTED_EXCEPTION",
    "details": {
      "stack": "DecodingError: expected string at (ContractTerms).auditors.[0].master_pub but got undefined\n at Object.decode (chrome-extension://cfegkgkeihndcnccpiaenkniipadokmb/dist/background.js:328:23)\n at Object.decode (chrome-extension://cfegkgkeihndcnccpiaenkniipadokmb/dist/background.js:178:52)\n at Object.decode (chrome-extension://cfegkgkeihndcnccpiaenkniipadokmb/dist/background.js:287:41)\n at Object.decode (chrome-extension://cfegkgkeihndcnccpiaenkniipadokmb/dist/background.js:178:52)\n at chrome-extension://cfegkgkeihndcnccpiaenkniipadokmb/dist/background.js:10030:65\n at Generator.next (<anonymous>)\n at fulfilled (chrome-extension://cfegkgkeihndcnccpiaenkniipadokmb/dist/background.js:22:62)"
    },
    "message": "unexpected exception (message: expected string at (ContractTerms).auditors.[0].master_pub but got undefined)"
  }
}


Additional InformationComplete merchant backend response from the chrome wallet using URL

curl 'http://merchant-backend.taler:9966/instances/blog/orders/2021.014-02PE3KD4TQR6C/claim' \
  -d '{"nonce":"QJ5065KTM75S52X9T10Y2A9WSVDVHGW97AASFFB4GCNJQHGRM380","token":"1BVHN7Y1XB273JKFC3BE9ZNHAC"}'

Response

{
  "contract_terms": {
    "amount": "COL:0.5",
    "extra": {
      "article_name": "Thank_You,_Larry_McVoy",
      "lang": "en"
    },
    "fulfillment_url": "http://blog.taler:8080/en/essay/Thank_You%2C_Larry_McVoy",
    "summary": "Essay: Thank You, Larry McVoy",
    "wire_transfer_deadline": {
      "t_ms": 1610659181000
    },
    "products": [],
    "h_wire": "Y5NSC4EZWJZCTAYMNZZC869THV6YPBW837XG0HWS2TQT34K196Q72WSN0EA375E5YYCQB7C5SMRAJT4AE9XX0BP2NRYB16GVT1MHNZ8",
    "wire_method": "x-taler-bank",
    "order_id": "2021.014-02PE3KD4TQR6C",
    "timestamp": {
      "t_ms": 1610658731000
    },
    "refund_deadline": {
      "t_ms": 1610658851000
    },
    "pay_deadline": {
      "t_ms": 1611868331000
    },
    "max_wire_fee": "COL:1",
    "max_fee": "COL:1",
    "wire_fee_amortization": 1,
    "merchant_base_url": "http://merchant-backend.taler:9966/instances/blog/",
    "merchant": {
      "name": "example.com",
      "instance": "blog",
      "address": {
        "country": "ar"
      },
      "jurisdiction": {
        "country": "ar"
      }
    },
    "exchanges": [
      {
        "url": "http://exchange.taler:8081/",
        "master_pub": "B5P9K9B3D39RETW7N0XN0Z1SWJFYZWGD1STSKWE6MR8J0PH6AF80"
      }
    ],
    "auditors": [
      {
        "name": "demo",
        "auditor_pub": "RVDXQVF2PVTK57EW13QTB6E44QRCPAQJBYKXPA1HCKXEGQETYVF0",
        "url": "http://auditor.taler:8083/"
      }
    ],
    "merchant_pub": "8VCKAV86JSZ2RWWZTTQPE2HSCV0BKVXDVJH27CCCV9HSNRQ0J1XG",
    "nonce": "QJ5065KTM75S52X9T10Y2A9WSVDVHGW97AASFFB4GCNJQHGRM380"
  },
  "sig": "NMEYRDGWCJZN3R4QY7EYG5BVWD1KKKJRNX1S3TEVBHZ7B1FHXYSJR0Z7R3EVMA6BY62Q7YHGZ42EVSF1H40CQ6EGVCRW01J4CA5F22R"
}


Related talerType function:

export const codecForAuditorHandle = (): Codec<AuditorHandle> =>
  buildCodecForObject<AuditorHandle>()
    .property("name", codecForString())
    .property("master_pub", codecForString()) // BUG? should it be auditor_pub?
    .property("url", codecForString())
    .build("AuditorHandle");


TagsNo tags attached.

Activities

sebasjm

2021-01-14 22:54

developer   ~0017346

Replacing master_pub with auditor_pub seems to work, at least for a simple payment flow but I dont know other consequences since I have not tested further.

sebasjm

2021-01-14 23:00

developer   ~0017347

Looking at master branch in wallet-core I have found that is already fixed in commit 6233fd39c35d77e54a19ee0d38773dfbe86e45ab

Closing issue

Florian Dold

2021-01-16 18:44

manager   ~0017359

This indeed has been fixed recently. The issue was caused by a rename of a field in the merchant backend (master_pub to auditor_pub).

Issue History

Date Modified Username Field Change
2021-01-14 22:44 sebasjm New Issue
2021-01-14 22:44 sebasjm Status new => assigned
2021-01-14 22:44 sebasjm Assigned To => Florian Dold
2021-01-14 22:54 sebasjm Note Added: 0017346
2021-01-14 23:00 sebasjm Note Added: 0017347
2021-01-16 18:44 Florian Dold Status assigned => resolved
2021-01-16 18:44 Florian Dold Resolution open => fixed
2021-01-16 18:44 Florian Dold Note Added: 0017359
2021-07-30 13:56 Christian Grothoff Fixed in Version => 0.8
2021-07-30 13:59 Christian Grothoff Target Version => 0.8.1
2021-07-30 14:01 Christian Grothoff Target Version 0.8.1 => 0.8
2021-08-24 16:23 Christian Grothoff Status resolved => closed