Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sync error: Cannot read properties of undefined (reading 'protocol') #294

Closed
frankhinek opened this issue Nov 15, 2023 · 0 comments · Fixed by #297
Closed

sync error: Cannot read properties of undefined (reading 'protocol') #294

frankhinek opened this issue Nov 15, 2023 · 0 comments · Fixed by #297
Assignees
Labels
bug Something isn't working

Comments

@frankhinek
Copy link
Contributor

Multiple people have reported receiving the following error:

sync error: Cannot read properties of undefined (reading 'protocol')

The following steps were provided on Discord:

Scenario:

  • 2 index.html files running in different browsers
  • both point to the same dwn-server running on localhost
  • each index has simple html buttons to perform
  • connect, create, read, update, send and an input text box to paste each others did into for the send call

1 for alice.html
1 for bob.html

alice -> web5.connect()
bob -> web5.connect()

alice -> configured the same protocol - a basic anyone all options (read, write, update, delete)
alice -> creates a 'hello bob' text record
alice -> record.send(bobs:did)

bob -> configured the same protocol - a basic anyone all options (read, write, update, delete)
bob -> queries records until it shows up
bob -> await record.data.text()
bob -> record.update({data: "hello alice" })
bob -> record.send(alices:did)

this works the record is sent to both and updated as expected but then ...
a couple minutes or so - the error starts showing up on both in the inspect console
protocol

    let protocolDefinition = {
      'protocol': 'https://message.app/protocol',
      'published': true,
      'types': {
        'message': {
          'schema': 'https://schema.org/message',
          'dataFormats': ['text/plain']
        }
      },
      'structure': {
        'message': {
          "$actions": [
            {
              "who": "anyone",
              "can": "write"
            },
            {
              "who": "anyone",
              "can": "delete"
            },
            {
              "who": "anyone",
              "can": "read"
            },
            {
              "who": "anyone",
              "can": "update"
            }    
          ]
        }
      }
    }

and after the error shows the syncing stops working

what the error looks like:
Screenshot_2023-11-14_at_6 21 24_PM
its intermittent -- this time it took about 10+ mins

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants