ssbc / ssb-schema-definitions

Standardised schema definitions for ssb message types using is-my-json-valid
3 stars 1 forks source link

ssb-mentions incompatibility #5

Open christianbundy opened 4 years ago

christianbundy commented 4 years ago
{
  "key": "%pNxUkDdWx+aMErDKZNoyEHbd7kK5XvaMORMiKHFsQos=.sha256",
  "value": {
    "previous": "%WyrmeoRvqFD66ptpLYSsxVv3WGgSkIo+k6eEEelj2II=.sha256",
    "sequence": 13197,
    "author": "@+oaWWDs8g73EZFUMfW37R/ULtFEjwKN/DczvdYihjbU=.ed25519",
    "timestamp": 1574191284942,
    "hash": "sha256",
    "content": {
      "type": "post",
      "root": "%uvuert8Y2MoSiIx36JJelrVLT/yb136nNHtYB02OJRI=.sha256",
      "branch": "%uvuert8Y2MoSiIx36JJelrVLT/yb136nNHtYB02OJRI=.sha256",
      "reply": {
        "%uvuert8Y2MoSiIx36JJelrVLT/yb136nNHtYB02OJRI=.sha256": "@kEfkso8s0TkVTv71qzi2g08lpFBC+Ci/VSPcdrh1MqQ=.ed25519"
      },
      "channel": null,
      "recps": null,
      "text": "[@Anna Bolica](@kEfkso8s0TkVTv71qzi2g08lpFBC+Ci/VSPcdrh1MqQ=.ed25519)\n\nHi!\n\nHere's your old feed, I think: @1PTtF/BnkfDFdyEyKpdolbJjs/VrAHIe1RO6vTQ3q2c=.ed25519\n ",
      "mentions": [
        {
          "link": "@kEfkso8s0TkVTv71qzi2g08lpFBC+Ci/VSPcdrh1MqQ=.ed25519",
          "name": "Anna Bolica"
        },
        {
          "link": "@1PTtF/BnkfDFdyEyKpdolbJjs/VrAHIe1RO6vTQ3q2c=.ed25519"
        }
      ]
    },
    "signature": "7useoY0lPYSSJ2EsJvy9iTzbLgITY6RhH0yNETigTyShW9KLtQiLW/y9DcgthCpejWayG+X1EtdxljPUeJ/6Dw==.sig.ed25519"
  },
  "timestamp": 1574191284943
}

Specifically:

{
  "mentions": [{
    "link": "@1PTtF/BnkfDFdyEyKpdolbJjs/VrAHIe1RO6vTQ3q2c=.ed25519"
  }]
}
ahdinosaur commented 4 years ago

hi @christianbundy, sorry what's wrong with this? is it that the above feed mention has no name, or that the schema requires a name when it should instead be optional?

christianbundy commented 4 years ago

I think that's right, yes.

christianbundy commented 4 years ago

To be explicit: Yes, it's one of those problems, but I'm not sure which. It's unclear to me whether this schema is meant to be loose or strict. I hit this problem again today.

Error: message should be valid replyAll: {
  "text": "[@SoapDog (SPX)](@0xkjAty6RSr5uhbAvi0rbVR2g9Bz+89qiKth48ECQBE=.ed25519)\r\n\r\nIn case you haven't already seen it:\r\n\r\n&Cm38CZBgQpcdJZGacLaR88u0ekeGPns81tWPvWVbMjQ=.sha256\r\n\r\nYou can save as a local HTML file and IIRC it saves your state in localstorage.",
  "mentions": [
    {
      "link": "@0xkjAty6RSr5uhbAvi0rbVR2g9Bz+89qiKth48ECQBE=.ed25519",
      "name": "SoapDog (SPX)"
    },
    {
      "link": "&Cm38CZBgQpcdJZGacLaR88u0ekeGPns81tWPvWVbMjQ=.sha256"
    }
  ],
  "root": "%4lztSiaUNsvHjF9TYPQoqDamUAuSbdA8+iePG/p9Wvo=.sha256",
  "branch": [
    "%3KhJ06qYWrIYSMK+U3Yv0RFitZ16jvrTAKp0Rp9+GeY=.sha256"
  ],
  "type": "post"
}
    at Object.replyAll (/home/christianbundy/src/oasis/src/pages/models/post.js:704:13)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async /home/christianbundy/src/oasis/src/app.js:205:18
    at async /home/christianbundy/src/oasis/src/app.js:56:5
    at async /home/christianbundy/src/oasis/node_modules/koa-mount/index.js:52:26