Can't edit the basicProfile nor create/edit ceramic documents

We can’t edit the basicProfile nor create/edit ceramic documents

Stream object data (Creating a document):

https://cerscan.com/mainnet/stream/kjzl6cwe1jw146pckypkw0w44pqdwbseui3ixfnar04usqxxuc86qtl7b922e77

{
    "streamId": "kjzl6cwe1jw146pckypkw0w44pqdwbseui3ixfnar04usqxxuc86qtl7b922e77",
    "state": {
        "type": 0,
        "content": {
            "content": {
                "app": "dBuzz",
                "body": "TESTS",
                "title": "",
                "debug_metadata": {
                    "user_id": "did:key:z6MkjU5URowjLy2CLYsDDwxrRZxav1RfjZ4rLAvXixvnuJnK"
                }
            },
            "parent_id": "8qse5p59ittzneqpfi7l9v",
            "created_at": "2023-09-12T14:31:47.183Z",
            "updated_at": "2023-09-12T14:31:47.183Z"
        },
        "metadata": {
            "tags": [
                "spk_network"
            ],
            "unique": "O8gWLdiyFmuMel/e",
            "controllers": [
                "did:key:z6MkjU5URowjLy2CLYsDDwxrRZxav1RfjZ4rLAvXixvnuJnK"
            ]
        },
        "signature": 2,
        "anchorStatus": "PENDING",
        "log": [
            {
                "cid": "bagcqcerahfodthz6sck22jq6enrxdlqxdcwjljzrv2vr3b6dg5mphmtxfjrq",
                "type": 0
            }
        ],
        "doctype": "tile"
    }
}

Stream object data (Editing basicProfile):

https://cerscan.com/mainnet/stream/k2t6wyfsu4pfym2l32c0b0h8r7kyk2mbpgiuyaufod2l93unmmyc7iz7vc1rx3

{
    "streamId": "k2t6wyfsu4pfym2l32c0b0h8r7kyk2mbpgiuyaufod2l93unmmyc7iz7vc1rx3",
    "state": {
        "type": 0,
        "content": {
            "kjzl6cwe1jw145cjbeko9kil8g9bxszjhyde21ob8epxuxkaon1izyqsu8wgcic": "ceramic://k2t6wyfsu4pg2pj7gbwhkzg4eoz16y1h0bw8v55gtk5exvcc0rmyxv315fd5qb",
            "ceramic://kjzl6cwe1jw149xy2w2qycwts4xjpvyzrkptdw20iui7r486bd6sasqb9tgglzp": "ceramic://k2t6wyfsu4pg0n6zaolm4l8qx9ldwnjekni84j8z72ovrdfkdngdfdtlqhyueq",
            "ceramic://kjzl6cwe1jw145f1327br2k7lkd5acrn6d2omh88xjt70ovnju491moahrxddns": "ceramic://k2t6wyfsu4pfwovixe271fypsg07nd3rphrdeew8k8ueehw0jvzuulv5wqmnah"
        },
        "metadata": {
            "family": "IDX",
            "controllers": [
                "did:key:z6MkjU5URowjLy2CLYsDDwxrRZxav1RfjZ4rLAvXixvnuJnK"
            ],
            "schema": "ceramic://k3y52l7qbv1fryjn62sggjh1lpn11c56qfofzmty190d62hwk1cal1c7qc5he54ow"
        },
        "signature": 2,
        "anchorStatus": "ANCHORED",
        "log": [
            {
                "cid": "bafyreicnitrfpgy42ms2xrwnekpkq2wpf5kiswsbon66nn2ft5fxwwg3s4",
                "type": 0,
                "timestamp": 1648804693
            },
            {
                "cid": "bagcqceratmexaaoxpukg5zhltpb4dodfrgigiooe6htpyj2ovh3m7vk3rj7a",
                "type": 1,
                "timestamp": 1648804693
            },
            {
                "cid": "bagcqcerapvyk53vc7yod6h63wjzgmfqcfgtquoccizthswy7ojpprfii56na",
                "type": 1,
                "timestamp": 1648804693
            },
            {
                "cid": "bafyreifn2vzm2eocayqy3r2onoq2nzx4fnnaqsabylb55n7ptihkaghgxu",
                "type": 2,
                "timestamp": 1648804693
            },
            {
                "cid": "bagcqcerap62uymfpjavhlug4hl4lnyopebqn4v63b3dbzi5a753lad7ytnsa",
                "type": 1,
                "timestamp": 1649002106
            },
            {
                "cid": "bagcqceranc5skrgukvslhrs42o4peixme3kv5zketd2tjki42fjlnntofe6q",
                "type": 1,
                "timestamp": 1649002106
            },
            {
                "cid": "bafyreie4vjnqdxwxb3as7iq6rbwaengynz3szhwykiwtl3xizcc6pkgkx4",
                "type": 2,
                "timestamp": 1649002106
            },
            {
                "cid": "bagcqcerasi5qhzb3rl5iulljhtfz66zfxwrs4u2pxtyj4p27h6oswkkf2wma",
                "type": 1,
                "timestamp": 1653058942
            },
            {
                "cid": "bafyreianbb4nc652us6gfsdg3jy2allm2pncdxtdayyxgz7mrd27fc5mb4",
                "type": 2,
                "timestamp": 1653058942
            }
        ],
        "anchorProof": {
            "root": "bafyreifkzw53vt6avxmsdngbbrn6ytkzqwcn7clzujvwbireenv6bscmie",
            "txHash": "bagjqcgzaxc646aqtgjv5qlg7hjxsf7jkqtsbk4yexfayunnsocdyvlniam5q",
            "chainId": "eip155:1",
            "blockNumber": 14811764,
            "blockTimestamp": 1653058942
        },
        "doctype": "tile"
    }
}

error-posting
error_editing

@spencer @mohsin - quick note that I’ve been connecting with @aashir over Discord as well on this topic. He pointed out that this only started happening a few days after, likely after they upgraded to the latest Ceramic versions.

I’ve asked @aashir to share the exact package versions they were using previously

@aashir can you share the code you are using to try to update the stream?

CC @paul as it looks like this is going through IDX

Yes sure, here’s the code:

import * as SpkNetwork from '@spknetwork/graph-client'
import { CeramicClient } from '@ceramicnetwork/http-client'
import { IDX } from '@ceramicstudio/idx'

export const SPK_INDEXER_HOST = 'https://offchain.us-02.infra.3speak.tv'

const ceramicClient = new CeramicClient('https://ceramic.us-02.infra.3speak.tv')
const spk = new SpkNetwork.SpkClient(SPK_INDEXER_HOST, ceramicClient)
const idx = new IDX({ceramic: ceramicClient, aliases: idxAliases})

// Create a new document
export const createPostRequest = async(did, permalink, body) => {
  try {
    return await spk.createDocument({
      app: 'dBuzz',
      title: '',
      body,
      debug_metadata: {
        user_id: did,
      },
    }, permalink)
  }
  catch (err) {
    console.log(err)
  }
}

// Update document

export const updatePostRequest = async(parentId, body) => {
  return await spk.updateDocument(parentId, {
    body: body,
  })
}

// Edit basicProfile

export const setBasicProfile = async(profile) => {
  const ipfsHashRegex = /Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[A-Za-z2-7]{58,}|B[A-Z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]{48,}|F[0-9A-F]{50,}/i
  const { profile_image, cover_image, name, about, location, website } = profile
  const avatar = profile_image ? `ipfs://${profile_image.match(ipfsHashRegex)[0]}` : 'ipfs://QmVGUC79fcxsUF9f2QpkZUTcDBfu6TRxhF1cBQfCebetPW'
  const background = cover_image ? `ipfs://${cover_image.match(ipfsHashRegex)[0]}` : 'ipfs://QmbPjSv8rMASqmndSxcNGEyoc5QYTgQWwVAdZVfqc1ygBT'
  return await idx.set('basicProfile', {
    image: {
      original: {
        src: avatar || '',
        width: 2560,
        height: 3840,
        mimeType: 'image/jpeg',
      },
    },
    background: {
      original: {
        src: background || '',
        width: 2560,
        height: 3840,
        mimeType: 'image/jpeg',
      },
    },
    name: name || '',
    description: about || '',
    location: location ||'',
    url: website || '',
  })
}

^ I hope this helps. @spencer

The IDX package has been deprecated for the past 2 years so it’s not really surprising if it starts causing issues, the Glaze or Self.ID SDK packages should be used instead, see The next architecture for building Web3 data apps
If possible, a better option would be to migrate to ComposeDB that we’re actively working on: https://composedb.js.org/