-
Notifications
You must be signed in to change notification settings - Fork 3
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
Add test object with URLs as properties (that have periods .
in them)
#19
Comments
Attempting to insert an operation like this does result in an uncaught error: {
'@context': 'https://example.com/somecontext',
type: 'CreateWebLedgerRecord',
record: {
'@context': 'https://example.com/somecontext',
'property.dot.annotation': false,
// id: intentionally omitted
type: 'Concert',
name: 'Primary Event',
startDate: '2017-07-14T21:30',
location: 'https://example.org/the-venue-new-york',
offers: {
type: 'Offer',
price: '13.00',
priceCurrency: 'USD',
url:
`https://example.org/purchase/a05bebf8-c966-427f-92f2-ff9060f4bd23`,
}
},
proof: {
type: 'RsaSignature2018',
created: '2017-05-10T19:47:13Z',
creator: "https://bedrock.local:18443/consensus/continuity2017/voters/57565658-0d8a-4668-b734-e801aeaa6472#key",
jws: "nlx8c9uFI8Ur/h57F5AeHHrKPSKiiGJmN6APRnYesQPK4LXftnm2lzqpWzsvKGDPzH6QfoOIktQu2Ax0pj/Bi6Oa4/Na75HuoRGppaHCqlyrgbr5EUPRCiYSjlsYKBhEN6ITdmR/O8iGz9WZi4PQjSW9XrrP8bQLeu9Kzsu5hdkzmgS4f3PCXpImwpKFttyF7xARvSQxrgRxZrqWPIGtD9sghRY2/Zn3T2npTaOTXMhgW9Lc7uEpjThnCEsrKflshbLGevZglc/njBp5SoEgon8CuzQIkMBFjCTEdJYBtTuk0AF5BcVyoxPDfH9bdUYOIMFaDhZBQKM5tQEU2GqE/g=="
}
}
|
This may lead to performance issues due to added encode/decode calls. Should consider only applying the transformations to the unknown data fields such as |
A bit more info to add here. The node mongo v3.1.3 driver produces the same error with mongodb server v3.6.7
It's unfortunate that this error is not being rethrown in such a way that includes some sort of error code. Even still, we could conceivably catch the error, check the message for |
@mattcollier For that to work there would have to also be some extra metadata stored to indicate data was encoded so that encode/decode could be properly paired up. |
Previous versions of MongoDB required that properties in documents that have periods
.
in them needed to be escaped. I suspect this hasn't changed. We have some encode/decode functions inbedrock-mongodb
to handle this:https://github.com/digitalbazaar/bedrock-mongodb/blob/master/lib/index.js#L380-L449
But we may not be using them here for object data in records in operations or in state machine storage. We should add a test that includes properties that would cause such an error and make sure we're covered through the process. We may have to add some encode/decode functions somewhere.
The text was updated successfully, but these errors were encountered: