When trying to send an extended message with attachments to RC 2.2.0, the server responds with success but I see a rocket.cat message of "Error" appear immediately and the server shows the following in the logs:
server.js:204 System ➔ error Error sending message: { Error: Invalid href value provided
at Where.Match.Where.value [as condition] (app/lib/server/functions/sendMessage.js:25:9)
at testSubtree (packages/check/match.js:308:24)
at check (packages/check/match.js:34:18)
at Object.keys.forEach.field (app/lib/server/functions/sendMessage.js:39:5)
at Array.forEach (<anonymous>)
at Where.Match.Where.value [as condition] (app/lib/server/functions/sendMessage.js:36:21)
at testSubtree (packages/check/match.js:308:24)
at check (packages/check/match.js:34:18)
at validateAttachment (app/lib/server/functions/sendMessage.js:76:2)
at Array.map (<anonymous>)
at validateBodyAttachments (app/lib/server/functions/sendMessage.js:114:62)
at validateMessage (app/lib/server/functions/sendMessage.js:128:3)
at sendMessage (app/lib/server/functions/sendMessage.js:137:2)
at MethodInvocation.sendMessage (app/lib/server/methods/sendMessage.js:86:11)
at MethodInvocation.methodsMap.(anonymous function) (app/lib/server/lib/debug.js:67:34)
at maybeAuditArgumentChecks (packages/ddp-server/livedata_server.js:1771:12)
at DDP._CurrentMethodInvocation.withValue (packages/ddp-server/livedata_server.js:719:19)
at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1234:12)
at DDPServer._CurrentWriteFence.withValue (packages/ddp-server/livedata_server.js:717:46)
at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1234:12)
at Promise (packages/ddp-server/livedata_server.js:715:46)
at new Promise (<anonymous>)
at Session.method (packages/ddp-server/livedata_server.js:689:23)
at packages/ddp-server/livedata_server.js:559:43 path: 'author_link' }
This occurs if I don't explicitly set one or more of the following:
titleLink
authorLink
authorIcon
imageUrl
audioUrl
videoUrl
The root cause appears to be that RC 2.0.0+ doesn't consider empty string ("") to be an omitted value any more and is running URL validity checks on them. If I explicitly set each of them to null then the message is sent successfully.
When trying to send an extended message with attachments to RC 2.2.0, the server responds with success but I see a rocket.cat message of "Error" appear immediately and the server shows the following in the logs:
This occurs if I don't explicitly set one or more of the following:
The root cause appears to be that RC 2.0.0+ doesn't consider empty string ("") to be an omitted value any more and is running URL validity checks on them. If I explicitly set each of them to null then the message is sent successfully.